\input{preamble}

% OK, start here.
%
\begin{document}

\title{Derived Categories of Schemes}


\maketitle

\phantomsection
\label{section-phantom}

\tableofcontents

\section{Introduction}
\label{section-introduction}

\noindent
In this chapter we discuss derived categories of modules on schemes.
Most of the material discussed here can be found in
\cite{TT}, \cite{Bokstedt-Neeman}, \cite{BvdB}, and \cite{LN}.
Of course there are many other references.


\section{Conventions}
\label{section-conventions}

\noindent
If $\mathcal{A}$ is an abelian category and $M$ is an object
of $\mathcal{A}$ then we also denote $M$ the object of $K(\mathcal{A})$
and/or $D(\mathcal{A})$ corresponding to the complex which has
$M$ in degree $0$ and is zero in all other degrees.

\medskip\noindent
If we have a ring $A$, then $K(A)$ denotes the homotopy category
of complexes of $A$-modules and $D(A)$ the associated derived category.
Similarly, if we have a ringed space $(X, \mathcal{O}_X)$ the symbol
$K(\mathcal{O}_X)$ denotes the homotopy category of complexes of
$\mathcal{O}_X$-modules and $D(\mathcal{O}_X)$ the associated derived
category.










\section{Derived category of quasi-coherent modules}
\label{section-derived-quasi-coherent}

\noindent
In this section we discuss the relationship between quasi-coherent
modules and all modules on a scheme $X$. A reference is
\cite[Appendix B]{TT}. By the discussion in
Schemes, Section \ref{schemes-section-quasi-coherent}
the embedding
$\QCoh(\mathcal{O}_X) \subset \textit{Mod}(\mathcal{O}_X)$
exhibits $\QCoh(\mathcal{O}_X)$ as a weak Serre subcategory of
the category of $\mathcal{O}_X$-modules. Denote
$$
D_\QCoh(\mathcal{O}_X) \subset D(\mathcal{O}_X)
$$
the subcategory of complexes whose cohomology sheaves are quasi-coherent, see
Derived Categories, Section \ref{derived-section-triangulated-sub}.
Thus we obtain a canonical functor
\begin{equation}
\label{equation-compare}
D(\QCoh(\mathcal{O}_X))
\longrightarrow
D_\QCoh(\mathcal{O}_X)
\end{equation}
see Derived Categories, Equation (\ref{derived-equation-compare}).

\begin{lemma}
\label{lemma-quasi-coherence-direct-sums}
Let $X$ be a scheme. Then $D_\QCoh(\mathcal{O}_X)$
has direct sums.
\end{lemma}

\begin{proof}
By Injectives, Lemma \ref{injectives-lemma-derived-products}
the derived category $D(\mathcal{O}_X)$ has direct sums and
they are computed by taking termwise direct sums of any representatives.
Thus it is clear that the cohomology sheaf of a direct sum is the
direct sum of the cohomology sheaves as taking direct sums is
an exact functor (in any Grothendieck abelian category). The lemma
follows as the direct sum of quasi-coherent sheaves is quasi-coherent, see
Schemes, Section \ref{schemes-section-quasi-coherent}.
\end{proof}

\noindent
We will need some information on derived limits. We warn the reader
that in the lemma below the derived limit will typically not be
an object of $D_\QCoh$.

\begin{lemma}
\label{lemma-Rlim-quasi-coherent}
Let $X$ be a scheme. Let $(K_n)$ be an inverse system of
$D_\QCoh(\mathcal{O}_X)$ with derived limit
$K = R\lim K_n$ in $D(\mathcal{O}_X)$. Assume $H^q(K_{n + 1}) \to H^q(K_n)$
is surjective for all $q \in \mathbf{Z}$ and $n \geq 1$.
Then
\begin{enumerate}
\item $H^q(K) = \lim H^q(K_n)$,
\item $R\lim H^q(K_n) = \lim H^q(K_n)$, and
\item for every affine open $U \subset X$ we have
$H^p(U, \lim H^q(K_n)) = 0$ for $p > 0$.
\end{enumerate}
\end{lemma}

\begin{proof}
Let $\mathcal{B}$ be the set of affine opens of $X$.
Since $H^q(K_n)$ is quasi-coherent we have $H^p(U, H^q(K_n)) = 0$
for $U \in \mathcal{B}$ by Cohomology of Schemes, Lemma
\ref{coherent-lemma-quasi-coherent-affine-cohomology-zero}.
Moreover, the maps $H^0(U, H^q(K_{n + 1})) \to H^0(U, H^q(K_n))$
are surjective for $U \in \mathcal{B}$ by
Schemes, Lemma \ref{schemes-lemma-equivalence-quasi-coherent}.
Part (1) follows from Cohomology, Lemma
\ref{cohomology-lemma-derived-limit-suitable-system}
whose conditions we have just verified.
Parts (2) and (3) follow from
Cohomology, Lemma \ref{cohomology-lemma-inverse-limit-is-derived-limit}.
\end{proof}

\noindent
The following lemma will help us to ``compute'' a right derived functor
on an object of $D_\QCoh(\mathcal{O}_X)$.

\begin{lemma}
\label{lemma-nice-K-injective}
Let $X$ be a scheme. Let $E$ be an object of
$D_\QCoh(\mathcal{O}_X)$. Then the map $E \to R\lim \tau_{\geq -n}E$ of
Derived Categories, Remark
\ref{derived-remark-map-into-derived-limit-truncations}
is an isomorphism\footnote{In particular,
$E$ has a K-injective representative by
Derived Categories, Lemma \ref{derived-lemma-difficulty-K-injectives}.}.
\end{lemma}

\begin{proof}
Denote $\mathcal{H}^i = H^i(E)$ the $i$th cohomology sheaf of $E$.
Let $\mathcal{B}$ be the set of affine open subsets of $X$. Then
$H^p(U, \mathcal{H}^i) = 0$ for all $p > 0$, all $i \in \mathbf{Z}$,
and all $U \in \mathcal{B}$, see
Cohomology of Schemes, Lemma
\ref{coherent-lemma-quasi-coherent-affine-cohomology-zero}.
Thus the lemma follows from
Cohomology, Lemma \ref{cohomology-lemma-is-limit-dimension}.
\end{proof}

\begin{lemma}
\label{lemma-application-nice-K-injective}
Let $X$ be a scheme. Let $F : \textit{Mod}(\mathcal{O}_X) \to \textit{Ab}$
be an additive functor and $N \geq 0$ an integer. Assume that
\begin{enumerate}
\item $F$ commutes with countable direct products,
\item $R^pF(\mathcal{F}) = 0$ for all $p \geq N$ and $\mathcal{F}$
quasi-coherent.
\end{enumerate}
Then for $E \in D_\QCoh(\mathcal{O}_X)$
\begin{enumerate}
\item $H^i(RF(\tau_{\leq a}E)) \to H^i(RF(E))$ is an isomorphism
for $i \leq a$,
\item $H^i(RF(E)) \to H^i(RF(\tau_{\geq b - N + 1}E))$ is an isomorphism
for $i \geq b$,
\item if $H^i(E) = 0$ for $i \not \in [a, b]$ for some
$-\infty \leq a \leq b \leq \infty$, then $H^i(RF(E)) = 0$
for $i \not \in [a, b + N - 1]$.
\end{enumerate}
\end{lemma}

\begin{proof}
Statement (1) is
Derived Categories, Lemma \ref{derived-lemma-negative-vanishing}.

\medskip\noindent
Proof of statement (2). Write $E_n = \tau_{\geq -n}E$. We have
$E = R\lim E_n$, see Lemma \ref{lemma-nice-K-injective}. Thus
$RF(E) = R\lim RF(E_n)$ in $D(\textit{Ab})$ by Injectives, Lemma
\ref{injectives-lemma-RF-commutes-with-Rlim}. Thus for every $i \in \mathbf{Z}$
we have a short exact sequence
$$
0 \to R^1\lim H^{i - 1}(RF(E_n)) \to H^i(RF(E)) \to \lim H^i(RF(E_n)) \to 0
$$
see More on Algebra, Remark
\ref{more-algebra-remark-compare-derived-limit}.
To prove (2) we will show that the term on the left is zero
and that the term on the right equals $H^i(RF(E_{-b + N - 1}))$
for any $b$ with $i \geq b$.

\medskip\noindent
For every $n$ we have a distinguished triangle
$$
H^{-n}(E)[n] \to E_n \to E_{n - 1} \to H^{-n}(E)[n + 1]
$$
(Derived Categories, Remark
\ref{derived-remark-truncation-distinguished-triangle})
in $D(\mathcal{O}_X)$. Since $H^{-n}(E)$ is quasi-coherent we have
$$
H^i(RF(H^{-n}(E)[n])) = R^{i + n}F(H^{-n}(E)) = 0
$$
for $i + n \geq N$ and
$$
H^i(RF(H^{-n}(E)[n + 1])) = R^{i + n + 1}F(H^{-n}(E)) = 0
$$
for $i + n + 1 \geq N$. We conclude that
$$
H^i(RF(E_n)) \to H^i(RF(E_{n - 1}))
$$
is an isomorphism for $n \geq N - i$. Thus the systems $H^i(RF(E_n))$ all
satisfy the ML condition and the $R^1\lim$ term in our short exact
sequence is zero (see discussion in
More on Algebra, Section \ref{more-algebra-section-Rlim}).
Moreover, the system $H^i(RF(E_n))$ is constant starting
with $n = N - i - 1$ as desired.

\medskip\noindent
Proof of (3). Under the assumption on $E$ we have
$\tau_{\leq a - 1}E = 0$ and we get the vanishing
of $H^i(RF(E))$ for $i \leq a - 1$ from (1).
Similarly, we have $\tau_{\geq b + 1}E = 0$ and hence
we get the vanishing of $H^i(RF(E))$ for $i \geq b + N$ from
part (2).
\end{proof}

\noindent
The following lemma is the key ingredient to many of the
results in this chapter.

\begin{lemma}
\label{lemma-affine-compare-bounded}
Let $X = \Spec(A)$ be an affine scheme. All the functors in the diagram
$$
\xymatrix{
D(\QCoh(\mathcal{O}_X)) \ar[rr]_{(\ref{equation-compare})}
& &
D_\QCoh(\mathcal{O}_X) \ar[ld]^{R\Gamma(X, -)} \\
& D(A) \ar[lu]^{\widetilde{\ \ }}
}
$$
are equivalences of triangulated categories. Moreover, for $E$ in
$D_\QCoh(\mathcal{O}_X)$ we have $H^0(X, E) = H^0(X, H^0(E))$.
\end{lemma}

\begin{proof}
The functor $R\Gamma(X, -)$ gives a functor
$D(\mathcal{O}_X) \to D(A)$ and hence by restriction a functor
\begin{equation}
\label{equation-back}
R\Gamma(X, -) : D_\QCoh(\mathcal{O}_X) \longrightarrow D(A).
\end{equation}
We will show this functor is quasi-inverse to (\ref{equation-compare})
via the equivalence between quasi-coherent modules on $X$ and
the category of $A$-modules.

\medskip\noindent
Elucidation. Denote $(Y, \mathcal{O}_Y)$ the one point space with sheaf
of rings given by $A$. Denote
$\pi : (X, \mathcal{O}_X) \to (Y, \mathcal{O}_Y)$
the obvious morphism of ringed spaces.
Then $R\Gamma(X, -)$ can be identified with $R\pi_*$ and the functor
(\ref{equation-compare}) via the equivalence
$\textit{Mod}(\mathcal{O}_Y) = \text{Mod}_A = \QCoh(\mathcal{O}_X)$
can be identified with $L\pi^* = \pi^* = \widetilde{\ }$ (see
Modules, Lemma \ref{modules-lemma-construct-quasi-coherent-sheaves} and
Schemes, Lemmas \ref{schemes-lemma-compare-constructions} and
\ref{schemes-lemma-equivalence-quasi-coherent}). Thus the functors
$$
\xymatrix{
D(A) \ar@<1ex>[r] & D(\mathcal{O}_X) \ar@<1ex>[l]
}
$$
are adjoint (by Cohomology, Lemma \ref{cohomology-lemma-adjoint}). In
particular we obtain canonical adjunction mappings
$$
a : \widetilde{R\Gamma(X, E)} \longrightarrow E
$$
for $E$ in $D(\mathcal{O}_X)$ and
$$
b : M^\bullet \longrightarrow R\Gamma(X, \widetilde{M^\bullet})
$$
for $M^\bullet$ a complex of $A$-modules.

\medskip\noindent
Let $E$ be an object of $D_\QCoh(\mathcal{O}_X)$. We may apply
Lemma \ref{lemma-application-nice-K-injective}
to the functor $F(-) = \Gamma(X, -)$
with $N = 1$ by Cohomology of Schemes, Lemma
\ref{coherent-lemma-quasi-coherent-affine-cohomology-zero}.
Hence
$$
H^0(R\Gamma(X, E)) = H^0(R\Gamma(X, \tau_{\geq 0}E)) = \Gamma(X, H^0(E))
$$
(the last equality by definition of the canonical truncation).
Using this we will show that the adjunction mappings $a$ and $b$
induce isomorphisms $H^0(a)$ and $H^0(b)$. Thus $a$ and $b$
are quasi-isomorphisms (as the statement is invariant under shifts)
and the lemma is proved.

\medskip\noindent
In both cases we use that $\widetilde{\ }$ is an exact functor
(Schemes, Lemma \ref{schemes-lemma-spec-sheaves}). Namely, this
implies that
$$
H^0\left(\widetilde{R\Gamma(X, E)}\right) =
\widetilde{H^0(R\Gamma(X, E))} =
\widetilde{\Gamma(X, H^0(E))}
$$
which is equal to $H^0(E)$ because $H^0(E)$ is quasi-coherent. Thus
$H^0(a)$ is an isomorphism. For the other direction we have
$$
H^0(R\Gamma(X, \widetilde{M^\bullet})) =
\Gamma(X, H^0(\widetilde{M^\bullet})) =
\Gamma(X, \widetilde{H^0(M^\bullet)}) =
H^0(M^\bullet)
$$
which proves that $H^0(b)$ is an isomorphism.
\end{proof}

\begin{lemma}
\label{lemma-affine-K-flat}
Let $X = \Spec(A)$ be an affine scheme. If $K^\bullet$ is a K-flat
complex of $A$-modules, then $\widetilde{K^\bullet}$ is a K-flat
complex of $\mathcal{O}_X$-modules.
\end{lemma}

\begin{proof}
By More on Algebra, Lemma \ref{more-algebra-lemma-base-change-K-flat}
we see that $K^\bullet \otimes_A A_\mathfrak p$ is a K-flat complex
of $A_\mathfrak p$-modules for every $\mathfrak p \in \Spec(A)$.
Hence we conclude from
Cohomology, Lemma \ref{cohomology-lemma-check-K-flat-stalks}
(and
Schemes, Lemma \ref{schemes-lemma-spec-sheaves})
that $\widetilde{K^\bullet}$ is K-flat.
\end{proof}

\begin{lemma}
\label{lemma-quasi-coherence-pushforward}
If $f : X \to Y$ is a morphism of affine schemes given by the ring map
$A \to B$, then the diagram
$$
\xymatrix{
D(B) \ar[d] \ar[r] & D_\QCoh(\mathcal{O}_X) \ar[d]^{Rf_*} \\
D(A) \ar[r] & D_\QCoh(\mathcal{O}_Y)
}
$$
commutes.
\end{lemma}

\begin{proof}
Follows from Lemma \ref{lemma-affine-compare-bounded}
using that $R\Gamma(Y, Rf_*K) = R\Gamma(X, K)$ by
Cohomology, Lemma \ref{cohomology-lemma-Leray-unbounded}.
\end{proof}

\begin{lemma}
\label{lemma-quasi-coherence-pullback}
Let $f : Y \to X$ be a morphism of schemes.
\begin{enumerate}
\item The functor $Lf^*$ sends $D_\QCoh(\mathcal{O}_X)$
into $D_\QCoh(\mathcal{O}_Y)$.
\item If $X$ and $Y$ are affine and $f$ is given by the ring map
$A \to B$, then the diagram
$$
\xymatrix{
D(B) \ar[r] & D_\QCoh(\mathcal{O}_Y) \\
D(A) \ar[r] \ar[u]^{- \otimes_A^\mathbf{L} B} &
D_\QCoh(\mathcal{O}_X) \ar[u]_{Lf^*}
}
$$
commutes.
\end{enumerate}
\end{lemma}

\begin{proof}
We first prove the diagram
$$
\xymatrix{
D(B) \ar[r] & D(\mathcal{O}_Y) \\
D(A) \ar[r] \ar[u]^{- \otimes_A^\mathbf{L} B} &
D(\mathcal{O}_X) \ar[u]_{Lf^*}
}
$$
commutes. This is clear from Lemma \ref{lemma-affine-K-flat} and
the constructions of the functors in question. To see (1) let
$E$ be an object of $D_\QCoh(\mathcal{O}_X)$. To see that
$Lf^*E$ has quasi-coherent cohomology sheaves we may work locally on $X$.
Note that $Lf^*$ is compatible with restricting to open subschemes.
Hence we can assume that $f$ is a morphism of affine schemes as in (2).
Then we can apply Lemma \ref{lemma-affine-compare-bounded} to see that
$E$ comes from a complex of $A$-modules. By the commutativity of the first
diagram of the proof the same holds for $Lf^*E$ and we conclude (1) is true.
\end{proof}

\begin{lemma}
\label{lemma-quasi-coherence-tensor-product}
Let $X$ be a scheme.
\begin{enumerate}
\item For objects $K, L$ of $D_\QCoh(\mathcal{O}_X)$
the derived tensor product $K \otimes^\mathbf{L}_{\mathcal{O}_X} L$ is in
$D_\QCoh(\mathcal{O}_X)$.
\item If $X = \Spec(A)$ is affine then
$$
\widetilde{M^\bullet} \otimes_{\mathcal{O}_X}^\mathbf{L} \widetilde{K^\bullet}
=
\widetilde{M^\bullet \otimes_A^\mathbf{L} K^\bullet}
$$
for any pair of complexes of $A$-modules $K^\bullet$, $M^\bullet$.
\end{enumerate}
\end{lemma}

\begin{proof}
The equality of (2) follows immediately from Lemma \ref{lemma-affine-K-flat}
and the construction of the derived tensor product.
To see (1) let $K, L$ be objects of $D_\QCoh(\mathcal{O}_X)$.
To check that $K \otimes^\mathbf{L} L$ is in
$D_\QCoh(\mathcal{O}_X)$ we may work locally on $X$, hence
we may assume $X = \Spec(A)$ is affine. By
Lemma \ref{lemma-affine-compare-bounded} we may represent
$K$ and $L$ by complexes of $A$-modules. Then part (2) implies
the result.
\end{proof}





\section{Total direct image}
\label{section-total-direct-image}

\noindent
The following lemma is the analogue of
Cohomology of Schemes, Lemma
\ref{coherent-lemma-quasi-coherence-higher-direct-images}.

\begin{lemma}
\label{lemma-quasi-coherence-direct-image}
Let $f : X \to S$ be a morphism of schemes.
Assume that $f$ is quasi-separated and quasi-compact.
\begin{enumerate}
\item The functor $Rf_*$ sends $D_\QCoh(\mathcal{O}_X)$
into $D_\QCoh(\mathcal{O}_S)$.
\item If $S$ is quasi-compact, there exists an integer $N = N(X, S, f)$
such that for an object $E$ of $D_\QCoh(\mathcal{O}_X)$
with $H^m(E) = 0$ for $m > 0$ we have
$H^m(Rf_*E) = 0$ for $m \geq N$.
\item In fact, if $S$ is quasi-compact we can find $N = N(X, S, f)$
such that for every morphism of schemes $S' \to S$
the same conclusion holds for the functor $R(f')_*$
where $f' : X' \to S'$ is the base change of $f$.
\end{enumerate}
\end{lemma}

\begin{proof}
Let $E$ be an object of $D_\QCoh(\mathcal{O}_X)$. To prove (1) we have to
show that $Rf_*E$ has quasi-coherent cohomology sheaves. The question is local
on $S$, hence we may assume $S$ is quasi-compact. Pick $N = N(X, S, f)$ as in
Cohomology of Schemes, Lemma
\ref{coherent-lemma-quasi-coherence-higher-direct-images}.
Thus $R^pf_*\mathcal{F} = 0$ for all quasi-coherent $\mathcal{O}_X$-modules
$\mathcal{F}$ and all $p \geq N$ and the same remains true after base change.

\medskip\noindent
First, assume $E$ is bounded below. We will show (1) and (2) and (3) hold
for such $E$ with our choice of $N$. In this case we can for example use the
spectral sequence
$$
R^pf_*H^q(E) \Rightarrow R^{p + q}f_*E
$$
(Derived Categories, Lemma \ref{derived-lemma-two-ss-complex-functor}),
the quasi-coherence of $R^pf_*H^q(E)$, and the vanishing of $R^pf_*H^q(E)$
for $p \geq N$ to see that (1), (2), and (3) hold in this case.

\medskip\noindent
Next we prove (2) and (3). Say $H^m(E) = 0$ for $m > 0$.
Let $U \subset S$ be affine open. By Cohomology of Schemes, Lemma
\ref{coherent-lemma-quasi-coherence-higher-direct-images-application}
and our choice of $N$
we have $H^p(f^{-1}(U), \mathcal{F}) = 0$ for $p \geq N$
and any quasi-coherent $\mathcal{O}_X$-module $\mathcal{F}$.
Hence we may apply Lemma \ref{lemma-application-nice-K-injective}
to the functor $\Gamma(f^{-1}(U), -)$ to see that
$$
R\Gamma(U, Rf_*E) = R\Gamma(f^{-1}(U), E)
$$
has vanishing cohomology in degrees $\geq N$. Since this holds for
all $U \subset S$ affine open we conclude that $H^m(Rf_*E) = 0$
for $m \geq N$.

\medskip\noindent
Next, we prove (1) in the general case. Recall that there is a
distinguished triangle
$$
\tau_{\leq -n - 1}E \to E \to \tau_{\geq -n}E \to
(\tau_{\leq -n - 1}E)[1]
$$
in $D(\mathcal{O}_X)$, see Derived Categories, Remark
\ref{derived-remark-truncation-distinguished-triangle}.
By (2) we see that $Rf_*\tau_{\leq -n - 1}E$
has vanishing cohomology sheaves in degrees $\geq -n + N$.
Thus, given an integer $q$ we see that $R^qf_*E$ is equal
to $R^qf_*\tau_{\geq -n}E$ for some $n$ and the result
above applies.
\end{proof}

\begin{lemma}
\label{lemma-acyclicity-lemma}
Let $f : X \to S$ be a quasi-separated and quasi-compact morphism
of schemes. Let $\mathcal{F}^\bullet$ be a complex of quasi-coherent
$\mathcal{O}_X$-modules each of which is right acyclic for $f_*$.
Then $f_*\mathcal{F}^\bullet$ represents $Rf_*\mathcal{F}^\bullet$
in $D(\mathcal{O}_S)$.
\end{lemma}

\begin{proof}
There is always a canonical map
$f_*\mathcal{F}^\bullet \to Rf_*\mathcal{F}^\bullet$.
Our task is to show that this is an isomorphism on cohomology sheaves.
As the statement is invariant under shifts it suffices to show that
$H^0(f_*(\mathcal{F}^\bullet)) \to R^0f_*\mathcal{F}^\bullet$
is an isomorphism. The statement is local on $S$ hence we
may assume $S$ affine. By
Lemma \ref{lemma-quasi-coherence-direct-image}
we have $R^0f_*\mathcal{F}^\bullet = R^0f_*\tau_{\geq -n}\mathcal{F}^\bullet$
for all sufficiently large $n$. Thus we may assume $\mathcal{F}^\bullet$
bounded below. As each $\mathcal{F}^n$ is right $f_*$-acyclic by
assumption we see that $f_*\mathcal{F}^\bullet \to Rf_*\mathcal{F}^\bullet$
is a quasi-isomorphism by Leray's acyclicity lemma (Derived Categories, Lemma
\ref{derived-lemma-leray-acyclicity}).
\end{proof}

\begin{lemma}
\label{lemma-acyclicity-lemma-global}
Let $X$ be a quasi-separated and quasi-compact scheme.
Let $\mathcal{F}^\bullet$ be a complex of quasi-coherent
$\mathcal{O}_X$-modules each of which is right acyclic for $\Gamma(X, -)$.
Then $\Gamma(X, \mathcal{F}^\bullet)$ represents
$R\Gamma(X, \mathcal{F}^\bullet)$ in $D(\Gamma(X, \mathcal{O}_X)$.
\end{lemma}

\begin{proof}
Apply Lemma \ref{lemma-acyclicity-lemma} to the canonical morphism
$X \to \Spec(\Gamma(X, \mathcal{O}_X))$. Some details omitted.
\end{proof}

\begin{lemma}
\label{lemma-spectral-sequence}
Let $X$ be a quasi-separated and quasi-compact scheme. For any object
$K$ of $D_\QCoh(\mathcal{O}_X)$ the spectral sequence
$$
E_2^{i, j} = H^i(X, H^j(K)) \Rightarrow H^{i + j}(X, K)
$$
of Cohomology, Example \ref{cohomology-example-spectral-sequence}
is bounded and converges.
\end{lemma}

\begin{proof}
By the construction of the spectral sequence via
Cohomology, Lemma \ref{cohomology-lemma-spectral-sequence-filtered-object}
using the filtration given by $\tau_{\leq -p}K$, we see that
suffices to show that given $n \in \mathbf{Z}$ we have
$$
H^n(X, \tau_{\leq -p}K) = 0 \text{ for } p \gg 0
$$
and
$$
H^n(X, K) = H^n(X, \tau_{\leq -p}K) \text{ for } p \ll 0
$$
The first follows from Lemma \ref{lemma-application-nice-K-injective}
applied with $F = \Gamma(X, -)$ and the bound in
Cohomology of Schemes, Lemma
\ref{coherent-lemma-quasi-coherence-higher-direct-images}.
The second holds whenever
$-p \leq n$ for any ringed space $(X, \mathcal{O}_X)$ and any
$K \in D(\mathcal{O}_X)$.
\end{proof}

\begin{lemma}
\label{lemma-quasi-coherence-pushforward-direct-sums}
Let $f : X \to S$ be a quasi-separated and quasi-compact morphism of
schemes. Then
$Rf_* : D_\QCoh(\mathcal{O}_X) \to D_\QCoh(\mathcal{O}_S)$
commutes with direct sums.
\end{lemma}

\begin{proof}
Let $E_i$ be a family of objects of $D_\QCoh(\mathcal{O}_X)$
and set $E = \bigoplus E_i$. We want to show that the map
$$
\bigoplus Rf_*E_i \longrightarrow Rf_*E
$$
is an isomorphism. We will show it induces an isomorphism on
cohomology sheaves in degree $0$ which will imply the lemma.
To prove this we may work locally on $S$, hence we may and do
assume that $S$ is quasi-compact.
Choose an integer $N$ as in Lemma \ref{lemma-quasi-coherence-direct-image}.
Then $R^0f_*E = R^0f_*\tau_{\geq -N}E$ and
$R^0f_*E_i = R^0f_*\tau_{\geq -N}E_i$ by the lemma cited. Observe that
$\tau_{\geq -N}E = \bigoplus \tau_{\geq -N}E_i$.
Thus we may assume all of the $E_i$ have vanishing cohomology
sheaves in degrees $< -N$. Next we use the spectral sequences
$$
R^pf_*H^q(E) \Rightarrow R^{p + q}f_*E
\quad\text{and}\quad
R^pf_*H^q(E_i) \Rightarrow R^{p + q}f_*E_i
$$
(Derived Categories, Lemma \ref{derived-lemma-two-ss-complex-functor})
to reduce to the case of a direct sum of quasi-coherent sheaves.
This case is handled by
Cohomology of Schemes, Lemma \ref{coherent-lemma-colimit-cohomology}.
\end{proof}









\section{Affine morphisms}
\label{section-affine-morphisms}

\noindent
In this section we collect some information about pushforward
along an affine morphism of schemes.

\begin{lemma}
\label{lemma-pushforward-affine-morphism}
Let $f : X \to S$ be an affine morphism of schemes. Let $\mathcal{F}^\bullet$
be a complex of quasi-coherent $\mathcal{O}_X$-modules. Then
$f_*\mathcal{F}^\bullet = Rf_*\mathcal{F}^\bullet$.
\end{lemma}

\begin{proof}
Combine Lemma \ref{lemma-acyclicity-lemma} with
Cohomology of Schemes, Lemma \ref{coherent-lemma-relative-affine-vanishing}.
An alternative proof is to work affine locally on $S$
and use Lemma \ref{lemma-quasi-coherence-pushforward}.
\end{proof}

\begin{lemma}
\label{lemma-affine-morphism}
Let $f : X \to S$ be an affine morphism of schemes.
Then
$Rf_* : D_\QCoh(\mathcal{O}_X) \to D_\QCoh(\mathcal{O}_S)$
reflects isomorphisms.
\end{lemma}

\begin{proof}
The statement means that a morphism $\alpha : E \to F$ of
$D_\QCoh(\mathcal{O}_X)$ is an isomorphism if
$Rf_*\alpha$ is an isomorphism. We may check this on cohomology sheaves.
In particular, the question is local on $S$. Hence we may assume $S$
and therefore $X$ is affine. In this case the statement is clear from
the description of the derived categories
$D_\QCoh(\mathcal{O}_X)$ and
$D_\QCoh(\mathcal{O}_S)$ given in
Lemma \ref{lemma-affine-compare-bounded}.
Some details omitted.
\end{proof}

\begin{lemma}
\label{lemma-affine-morphism-pull-push}
Let $f : X \to S$ be an affine morphism of schemes.
For $E$ in $D_\QCoh(\mathcal{O}_S)$ we have
$Rf_* Lf^* E = E \otimes^\mathbf{L}_{\mathcal{O}_S} f_*\mathcal{O}_X$.
\end{lemma}

\begin{proof}
Since $f$ is affine the map $f_*\mathcal{O}_X \to Rf_*\mathcal{O}_X$
is an isomorphism
(Cohomology of Schemes, Lemma \ref{coherent-lemma-relative-affine-vanishing}).
There is a canonical map $E \otimes^\mathbf{L} f_*\mathcal{O}_X =
E \otimes^\mathbf{L} Rf_*\mathcal{O}_X \to Rf_* Lf^* E$
adjoint to the map
$$
Lf^*(E \otimes^\mathbf{L} Rf_*\mathcal{O}_X) =
Lf^*E \otimes^\mathbf{L} Lf^*Rf_*\mathcal{O}_X \longrightarrow
Lf^* E \otimes^\mathbf{L} \mathcal{O}_X = Lf^* E
$$
coming from $1 : Lf^*E \to Lf^*E$ and the canonical map
$Lf^*Rf_*\mathcal{O}_X \to \mathcal{O}_X$. To check the map so constructed
is an isomorphism we may work locally on $S$. Hence we may assume
$S$ and therefore $X$ is affine. In this case the statement is clear from
the description of the derived categories
$D_\QCoh(\mathcal{O}_X)$ and
$D_\QCoh(\mathcal{O}_S)$ and the functor $Lf^*$ given in
Lemmas \ref{lemma-affine-compare-bounded} and
\ref{lemma-quasi-coherence-pullback}.
Some details omitted.
\end{proof}

\noindent
Let $Y$ be a scheme. Let $\mathcal{A}$ be a sheaf of $\mathcal{O}_Y$-algebras.
We will denote $D_\QCoh(\mathcal{A})$ the inverse image of
$D_\QCoh(\mathcal{O}_X)$ under the restriction functor
$D(\mathcal{A}) \to D(\mathcal{O}_X)$. In other words, $K \in D(\mathcal{A})$
is in $D_\QCoh(\mathcal{A})$ if and only if its cohomology sheaves are
quasi-coherent as $\mathcal{O}_X$-modules. If $\mathcal{A}$ is quasi-coherent
itself this is the same as asking the cohomology sheaves to be quasi-coherent
as $\mathcal{A}$-modules, see
Morphisms, Lemma \ref{morphisms-lemma-affine-equivalence-modules}.

\begin{lemma}
\label{lemma-affine-morphism-equivalence}
Let $f : X \to Y$ be an affine morphism of schemes. Then $f_*$ induces
an equivalence
$$
\Phi : D_\QCoh(\mathcal{O}_X) \longrightarrow D_\QCoh(f_*\mathcal{O}_X)
$$
whose composition with $D_\QCoh(f_*\mathcal{O}_X) \to D_\QCoh(\mathcal{O}_Y)$
is $Rf_* : D_\QCoh(\mathcal{O}_X) \to D_\QCoh(\mathcal{O}_Y)$.
\end{lemma}

\begin{proof}
Recall that $Rf_*$ is computed on an object $K \in D_\QCoh(\mathcal{O}_X)$
by choosing a K-injective complex $\mathcal{I}^\bullet$ of
$\mathcal{O}_X$-modules representing $K$ and taking $f_*\mathcal{I}^\bullet$.
Thus we let $\Phi(K)$ be the complex $f_*\mathcal{I}^\bullet$
viewed as a complex of $f_*\mathcal{O}_X$-modules.
Denote $g : (X, \mathcal{O}_X) \to (Y, f_*\mathcal{O}_X)$ the
obvious morphism of ringed spaces. Then $g$ is a flat morphism of
ringed spaces (see below for a description of the stalks) and
$\Phi$ is the restriction of $Rg_*$ to $D_\QCoh(\mathcal{O}_X)$.
We claim that $Lg^*$ is a quasi-inverse. First, observe that
$Lg^*$ sends $D_\QCoh(f_*\mathcal{O}_X)$ into $D_\QCoh(\mathcal{O}_X)$
because $g^*$ transforms quasi-coherent modules into quasi-coherent
modules (Modules, Lemma \ref{modules-lemma-pullback-quasi-coherent}).
To finish the proof it suffices to show that
the adjunction mappings
$$
Lg^*\Phi(K) = Lg^*Rg_*K \to K
\quad\text{and}\quad
M \to Rg_*Lg^*M = \Phi(Lg^*M)
$$
are isomorphisms for $K \in D_\QCoh(\mathcal{O}_X)$ and
$M \in D_\QCoh(f_*\mathcal{O}_X)$. This is a local question, hence
we may assume $Y$ and therefore $X$ are affine.

\medskip\noindent
Assume $Y = \Spec(B)$ and $X = \Spec(A)$. Let
$\mathfrak p = x \in \Spec(A) = X$ be a point mapping to
$\mathfrak q = y \in \Spec(B) = Y$. Then
$(f_*\mathcal{O}_X)_y = A_\mathfrak q$ and $\mathcal{O}_{X, x} = A_\mathfrak p$
hence $g$ is flat. Hence $g^*$ is exact and $H^i(Lg^*M) = g^*H^i(M)$
for any $M$ in $D(f_*\mathcal{O}_X)$.
For $K \in D_\QCoh(\mathcal{O}_X)$ we see that
$$
H^i(\Phi(K)) = H^i(Rf_*K) = f_*H^i(K)
$$
by the vanishing of higher direct images
(Cohomology of Schemes, Lemma \ref{coherent-lemma-relative-affine-vanishing})
and Lemma \ref{lemma-application-nice-K-injective} (small detail omitted).
Thus it suffice to show that
$$
g^*g_*\mathcal{F} \to \mathcal{F}
\quad\text{and}\quad
\mathcal{G} \to g_*g^*\mathcal{G}
$$
are isomorphisms where $\mathcal{F}$ is
a quasi-coherent $\mathcal{O}_X$-module and $\mathcal{G}$ is
a quasi-coherent $f_*\mathcal{O}_X$-module. This follows from
Morphisms, Lemma \ref{morphisms-lemma-affine-equivalence-modules}.
\end{proof}





\section{Cohomology with support in a closed subset}
\label{section-cohomology-support}

\noindent
We elaborate on the material in Cohomology, Sections
\ref{cohomology-section-cohomology-support} and
\ref{cohomology-section-cohomology-support-bis} for schemes
and quasi-coherent modules.

\begin{definition}
\label{definition-supported-on}
Let $X$ be a scheme. Let $E$ be an object of $D(\mathcal{O}_X)$.
Let $T \subset X$ be a closed subset.
We say $E$ is {\it supported on $T$} if the
cohomology sheaves $H^i(E)$ are supported on $T$.
\end{definition}

\noindent
We repeat some of the discussion from
Cohomology, Section \ref{cohomology-section-cohomology-support-bis}
in the situation of the definition.
Let $X$ be a scheme. Let $T \subset X$ be a closed subset.
The category of $\mathcal{O}_X$-modules whose
support is contained in $T$ is a Serre subcategory of the
category of all $\mathcal{O}_X$-modules, see
Homology, Definition \ref{homology-definition-serre-subcategory}
and
Modules, Lemma \ref{modules-lemma-support-section-closed}.
Thus we may apply the discussion in
Derived Categories, Section \ref{derived-section-triangulated-sub}
and we obtain a strictly full, saturated triangulated subcategory of
$D(\mathcal{O}_X)$ consisting of objects supported on $T$; we will
denote this category $D_T(\mathcal{O}_X)$ in the following.

\medskip\noindent
In the situation of Definition \ref{definition-supported-on}
denote $i : T \to X$ the inclusion map. Recall from
Cohomology, Section \ref{cohomology-section-cohomology-support-bis}
that in this situation we have a functor
$R\mathcal{H}_T : D(\mathcal{O}_X) \to D(i^{-1}\mathcal{O}_X)$
which is right adjoint to $i_* : D(i^{-1}\mathcal{O}_X) \to D(\mathcal{O}_X)$.

\begin{lemma}
\label{lemma-support-quasi-coherent}
Let $X$ be a scheme. Let $T \subset X$ be a closed subset such that
$X \setminus T$ is a retrocompact open of $X$. Let $i : T \to X$ be
the inclusion.
\begin{enumerate}
\item For $E$ in $D_\QCoh(\mathcal{O}_X)$ we have
$i_*R\mathcal{H}_T(E)$ in $D_{\QCoh, T}(\mathcal{O}_X)$.
\item The functor
$i_* \circ R\mathcal{H}_T : D_\QCoh(\mathcal{O}_X) \to
D_{\QCoh, T}(\mathcal{O}_X)$ is right adjoint to the inclusion functor
$D_{\QCoh, T}(\mathcal{O}_X) \to D_\QCoh(\mathcal{O}_X)$.
\end{enumerate}
\end{lemma}

\begin{proof}
Set $U = X \setminus T$ and denote $j : U \to X$ the inclusion. By
Cohomology, Lemma \ref{cohomology-lemma-triangle-sections-with-support-sheaves}
there is a distinguished triangle
$$
i_*R\mathcal{H}_T(E) \to E \to Rj_*(E|_U) \to i_*R\mathcal{H}_Z(E)[1]
$$
in $D(\mathcal{O}_X)$. By Lemma \ref{lemma-quasi-coherence-direct-image}
the complex $Rj_*(E|_U)$ has quasi-coherent cohomology sheaves
(this is where we use that $U$ is retrocompact in $X$).
Thus we see that (1) is true. Part (2) follows from this and
the adjointness of functors in
Cohomology, Lemma \ref{cohomology-lemma-complexes-with-support-on-closed}.
\end{proof}

\begin{lemma}
\label{lemma-support-direct-sums}
Let $X$ be a scheme. Let $T \subset X$ be a closed subset such that
$X \setminus T$ is a retrocompact open of $X$. Then for a family of
objects $E_i$, $i \in I$ of $D_\QCoh(\mathcal{O}_X)$ we have
$R\mathcal{H}_T(\bigoplus E_i) = \bigoplus R\mathcal{H}_T(E_i)$.
\end{lemma}

\begin{proof}
Set $U = X \setminus T$ and denote $j : U \to X$ the inclusion. By
Cohomology, Lemma \ref{cohomology-lemma-triangle-sections-with-support-sheaves}
there is a distinguished triangle
$$
i_*R\mathcal{H}_T(E) \to E \to Rj_*(E|_U) \to i_*R\mathcal{H}_Z(E)[1]
$$
in $D(\mathcal{O}_X)$ for any $E$ in $D(\mathcal{O}_X)$. The functor
$E \mapsto Rj_*(E|_U)$ commutes with direct sums on $D_\QCoh(\mathcal{O}_X)$
by Lemma \ref{lemma-quasi-coherence-pushforward-direct-sums}.
It follows that the same is true for the functor $i_* \circ R\mathcal{H}_T$
(details omitted). Since $i_* : D(i^{-1}\mathcal{O}_X) \to D_T(\mathcal{O}_X)$
is an equivalence
(Cohomology, Lemma \ref{cohomology-lemma-complexes-with-support-on-closed})
we conclude.
\end{proof}

\begin{remark}
\label{remark-support-c-equations}
Let $X$ be a scheme. Let $f_1, \ldots, f_c \in \Gamma(X, \mathcal{O}_X)$.
Denote $Z \subset X$ the closed subscheme cut out by $f_1, \ldots, f_c$.
For $0 \leq p < c$ and $1 \leq i_0 < \ldots < i_p \leq c$ we denote
$U_{i_0 \ldots i_p} \subset X$ the open subscheme where
$f_{i_0} \ldots f_{i_p}$ is invertible. For any $\mathcal{O}_X$-module
$\mathcal{F}$ we set
$$
\mathcal{F}_{i_0 \ldots i_p} =
(U_{i_0 \ldots i_p} \to X)_*(\mathcal{F}|_{U_{i_0 \ldots i_p}})
$$
In this situation the {\it extended alternating {\v C}ech complex}
is the complex of $\mathcal{O}_X$-modules
\begin{equation}
\label{equation-extended-alternating}
0 \to \mathcal{F} \to
\bigoplus\nolimits_{i_0} \mathcal{F}_{i_0} \to
\ldots \to
\bigoplus\nolimits_{i_0 < \ldots < i_p} \mathcal{F}_{i_0 \ldots i_p} \to
\ldots \to \mathcal{F}_{1 \ldots c} \to 0
\end{equation}
where $\mathcal{F}$ is put in degree $0$. The maps are constructed as
follows. Given
$1 \leq i_0 < \ldots < i_{p + 1} \leq c$ and $0 \leq j \leq p + 1$ we
have the canonical map
$$
\mathcal{F}_{i_0 \ldots \hat i_j \ldots i_{p + 1}} \to
\mathcal{F}_{i_0 \ldots i_p}
$$
coming from the inclusion
$U_{i_0 \ldots i_p} \subset U_{i_0 \ldots \hat i_j \ldots i_{p + 1}}$.
The differentials in the extended alternating complex use these
canonical maps with sign $(-1)^j$.
\end{remark}

\begin{lemma}
\label{lemma-extended-alternating-zero}
With $X$, $f_1, \ldots, f_c \in \Gamma(X, \mathcal{O}_X)$, and
$\mathcal{F}$ as in Remark \ref{remark-support-c-equations}
the complex (\ref{equation-extended-alternating}) restricts to an acyclic
complex over $X \setminus Z$.
\end{lemma}

\noindent
We remark that this lemma holds more generally for any
extended alternating {\v C}ech complex defined as in
Remark \ref{remark-support-c-equations} starting with a finite
open covering $X \setminus Z = U_1 \cup \ldots \cup U_c$.

\begin{proof}
Let $W \subset X \setminus Z$ be an open subset. Evaluating the complex
of sheaves (\ref{equation-extended-alternating}) on $W$ we obtain the
complex
$$
\mathcal{F}(W) \to \bigoplus\nolimits_{i_0} \mathcal{F}(U_{i_0} \cap W) \to
\bigoplus\nolimits_{i_0 < i_1} \mathcal{F}(U_{i_0i_1} \cap W) \to \ldots
$$
In other words, we obtain the extended ordered {\v C}ech complex
for the covering $W = \bigcup U_i \cap W$ and the standard
ordering on $\{1, \ldots, c\}$, see
Cohomology, Section \ref{cohomology-section-alternating-cech}.
By Cohomology, Lemma \ref{cohomology-lemma-alternating-cech-trivial}
this complex is homotopic to zero as soon as $W$ is contained in
$V(f_i)$ for some $1 \leq i \leq c$. This finishes the proof.
\end{proof}

\begin{remark}
\label{remark-extended-alternating-map-to-support}
Let $X$, $f_1, \ldots, f_c \in \Gamma(X, \mathcal{O}_X)$, and
$\mathcal{F}$ be as in Remark \ref{remark-support-c-equations}.
Denote $\mathcal{F}^\bullet$ the complex
(\ref{equation-extended-alternating}). By
Lemma \ref{lemma-extended-alternating-zero}
the cohomology sheaves of $\mathcal{F}^\bullet$
are supported on $Z$ hence $\mathcal{F}^\bullet$ is an object of
$D_Z(\mathcal{O}_X)$. On the other hand, the equality
$\mathcal{F}^0 = \mathcal{F}$ determines a canonical map
$\mathcal{F}^\bullet \to \mathcal{F}$ in $D(\mathcal{O}_X)$.
As $i_* \circ R\mathcal{H}_Z$ is a right adjoint to the
inclusion functor $D_Z(\mathcal{O}_X) \to D(\mathcal{O}_X)$, see
Cohomology, Lemma \ref{cohomology-lemma-complexes-with-support-on-closed},
we obtain a canonical commutative diagram
$$
\xymatrix{
\mathcal{F}^\bullet \ar[rd] \ar[rr] & & \mathcal{F} \\
& i_*R\mathcal{H}_Z(\mathcal{F}) \ar[ru]
}
$$
in $D(\mathcal{O}_X)$ functorial in the $\mathcal{O}_X$-module $\mathcal{F}$.
\end{remark}

\begin{lemma}
\label{lemma-extended-alternating-represented}
With $X$, $f_1, \ldots, f_c \in \Gamma(X, \mathcal{O}_X)$, and
$\mathcal{F}$ as in Remark \ref{remark-support-c-equations}.
If $\mathcal{F}$ is quasi-coherent, then the complex
(\ref{equation-extended-alternating}) represents
$i_* R\mathcal{H}_Z(\mathcal{F})$ in $D_Z(\mathcal{O}_X)$.
\end{lemma}

\begin{proof}
Let us denote $\mathcal{F}^\bullet$ the complex
(\ref{equation-extended-alternating}).
The statement of the lemma means that the map
$\mathcal{F}^\bullet \to i_*R\mathcal{H}_Z(\mathcal{F})$
of Remark \ref{remark-extended-alternating-map-to-support}
is an isomorphism. Since $\mathcal{F}^\bullet$ is in
$D_Z(\mathcal{O}_X)$ (see remark cited), we see that
$i_*R\mathcal{H}_Z(\mathcal{F}^\bullet) = \mathcal{F}^\bullet$
by Cohomology, Lemma \ref{cohomology-lemma-complexes-with-support-on-closed}.
The morphism $U_{i_0 \ldots i_p} \to X$ is affine
as it is given over affine opens of $X$ by inverting the function
$f_{i_0} \ldots f_{i_p}$. Thus we see that
$$
\mathcal{F}_{i_0 \ldots i_p} =
(U_{i_0 \ldots i_p} \to X)_*\mathcal{F}|_{U_{i_0 \ldots i_p}} =
R(U_{i_0 \ldots i_p} \to X)_*\mathcal{F}|_{U_{i_0 \ldots i_p}}
$$
by Cohomology of Schemes, Lemma \ref{coherent-lemma-relative-affine-vanishing}
and the assumption that $\mathcal{F}$ is quasi-coherent. We conclude that
$R\mathcal{H}_Z(\mathcal{F}_{i_0 \ldots i_p}) = 0$ by Cohomology, Lemma
\ref{cohomology-lemma-sections-support-in-closed-disjoint-open}.
Thus $i_*R\mathcal{H}_Z(\mathcal{F}^p) = 0$ for $p > 0$.
Putting everything together we obtain
$$
\mathcal{F}^\bullet = i_*R\mathcal{H}_Z(\mathcal{F}^\bullet) =
i_*R\mathcal{H}_Z(\mathcal{F})
$$
as desired.
\end{proof}

\begin{lemma}
\label{lemma-supported-trivial-vanishing}
Let $X$ be a scheme. Let $T \subset X$ be a closed subset which can
locally be cut out by at most $c$ elements of the structure sheaf.
Then $\mathcal{H}^i_Z(\mathcal{F}) = 0$ for $i > c$ and any
quasi-coherent $\mathcal{O}_X$-module $\mathcal{F}$.
\end{lemma}

\begin{proof}
This follows immediately from the local description of
$R\mathcal{H}_T(\mathcal{F})$ given in
Lemma \ref{lemma-extended-alternating-represented}.
\end{proof}

\begin{lemma}
\label{lemma-supported-vanishing}
Let $X$ be a scheme. Let $Z \subset X$ be a closed subset which can
locally be cut out by a Koszul regular sequence having $c$ elements.
Then $\mathcal{H}^i_Z(\mathcal{F}) = 0$ for $i \not = c$ for every
flat, quasi-coherent $\mathcal{O}_X$-module $\mathcal{F}$.
\end{lemma}

\begin{proof}
By the description of $R\mathcal{H}_Z(\mathcal{F})$ given in
Lemma \ref{lemma-extended-alternating-represented} this boils
down to the following algebra statement: given a ring $R$,
a Koszul regular sequence $f_1, \ldots, f_c \in R$, and a flat
$R$-module $M$, the extended alternating {\v C}ech complex
$M \to \bigoplus\nolimits_{i_0} M_{f_{i_0}} \to
\bigoplus\nolimits_{i_0 < i_1} M_{f_{i_0}f_{i_1}} \to
\ldots \to M_{f_1 \ldots f_c}$
from More on Algebra, Section \ref{more-algebra-section-alternating-cech}
only has cohomology in degree $c$. By More on Algebra, Lemma
\ref{more-algebra-lemma-vanishing-extended-alternating-koszul}
we obtain the desired vanishing for the extended alternating
{\v C}ech complex of $R$. Since the complex for $M$ is obtained
by tensoring this with the flat $R$-module $M$
(More on Algebra, Lemma
\ref{more-algebra-lemma-extended-alternating-form-module})
we conclude.
\end{proof}

\begin{remark}
\label{remark-supported-map-c-equations}
With $X$, $f_1, \ldots, f_c \in \Gamma(X, \mathcal{O}_X)$, and
$\mathcal{F}$ as in Remark \ref{remark-support-c-equations}.
There is a canonical $\mathcal{O}_X|_Z$-linear map
$$
c_{f_1, \ldots, f_c} :
i^*\mathcal{F}
\longrightarrow
\mathcal{H}^c_Z(\mathcal{F})
$$
functorial in $\mathcal{F}$. Namely, denoting $\mathcal{F}^\bullet$ the
extended alternating {\v C}ech complex (\ref{equation-extended-alternating})
we have the canonical map
$\mathcal{F}^\bullet \to i_*R\mathcal{H}_Z(\mathcal{F})$
of Remark \ref{remark-extended-alternating-map-to-support}.
This determines a canonical map
$$
\Coker\left(\bigoplus \mathcal{F}_{1 \ldots \hat i \ldots c} \to
\mathcal{F}_{1 \ldots c}\right)
\longrightarrow
i_*\mathcal{H}^c_Z(\mathcal{F})
$$
on cohomology sheaves in degree $c$.
Given a local section $s$ of $\mathcal{F}$ we can consider the
local section
$$
\frac{s}{f_1 \ldots f_c}
$$
of $\mathcal{F}_{1 \ldots c}$. The class of this section in the cokernel
displayed above depends only on $s$ modulo the image of
$(f_1, \ldots, f_c) : \mathcal{F}^{\oplus c} \to \mathcal{F}$.
Since $i_*i^*\mathcal{F}$ is equal to the cokernel of
$(f_1, \ldots, f_c) : \mathcal{F}^{\oplus c} \to \mathcal{F}$
we see that we get an $\mathcal{O}_X$-module map
$i_*i^*\mathcal{F} \to i_*\mathcal{H}_Z^c(\mathcal{F})$.
As $i_*$ is fully faithful we get the map $c_{f_1, \ldots, f_c}$.
\end{remark}

\begin{example}
\label{example-affine-supported-map-c-equations}
Let $X = \Spec(A)$ be affine, $f_1, \ldots, f_c \in A$, and let
$\mathcal{F} = \widetilde{M}$ for some $A$-module $M$. The map
$c_{f_1, \ldots, f_c}$ of Remark \ref{remark-supported-map-c-equations}
can be described as the map
$$
M/(f_1, \ldots, f_c)M
\longrightarrow
\Coker\left(
\bigoplus M_{f_1 \ldots \hat f_i \ldots f_c} \to M_{f_1 \ldots f_c}
\right)
$$
sending the class of $s \in M$ to the class of $s/f_1 \ldots f_c$
in the cokernel.
\end{example}

\begin{lemma}
\label{lemma-supported-map-determinant}
With $X$, $f_1, \ldots, f_c \in \Gamma(X, \mathcal{O}_X)$, and
$\mathcal{F}$ as in Remark \ref{remark-support-c-equations}.
Let $a_{ji} \in \Gamma(X, \mathcal{O}_X)$ for $1 \leq i, j \leq c$
and set $g_j = \sum_{i = 1, \ldots, c} a_{ji}f_i$. Assume $g_1, \ldots, g_c$
scheme theoretically cut out $Z$. If $\mathcal{F}$ is quasi-coherent, then
$$
c_{f_1, \ldots, f_c} = \det(a_{ji}) c_{g_1, \ldots, g_c}
$$
where $c_{f_1, \ldots, f_c}$ and $c_{g_1, \ldots, g_c}$ are as in
Remark \ref{remark-supported-map-c-equations}.
\end{lemma}

\begin{proof}
We will prove that $c_{f_1, \ldots, f_c}(s) =
\det(a_{ij}) c_{g_1, \ldots, g_c}(s)$ as global sections of
$\mathcal{H}_Z(\mathcal{F})$ for any $s \in \mathcal{F}(X)$.
This is sufficient since we then obtain the same result for
section over any open subscheme of $X$.
To do this, for $1 \leq i_0 < \ldots < i_p \leq c$
and $1 \leq j_0 < \ldots < j_q \leq c$ we denote
$U_{i_0 \ldots i_p} \subset X$,
$V_{j_0 \ldots j_q} \subset X$, and
$W_{i_0 \ldots i_p, j_0 \ldots j_q} \subset X$
the open subscheme where $f_{i_0} \ldots f_{i_p}$ is invertible,
$g_{j_0} \ldots g_{j_q}$ is invertible, and where
$f_{i_0} \ldots f_{i_p}g_{j_0} \ldots g_{j_q}$ is invertible.
We denote $\mathcal{F}_{i_0 \ldots i_p}$,
resp.\ $\mathcal{F}'_{j_0 \ldots j_q}$
$\mathcal{F}''_{i_0 \ldots i_p, j_0 \ldots j_q}$
the pushforward to $X$ of the restriction of $\mathcal{F}$ to
$U_{i_0 \ldots i_p}$, resp.\ $V_{j_0 \ldots j_q}$,
resp.\ $W_{i_0 \ldots i_p, j_0 \ldots j_q}$.
Then we obtain three extended alternating {\v C}ech complexes
$$
\mathcal{F}^\bullet :
\mathcal{F} \to \bigoplus\nolimits_{i_0} \mathcal{F}_{i_0} \to
\bigoplus\nolimits_{i_0 < i_1} \mathcal{F}_{i_0i_1} \to \ldots
$$
and
$$
(\mathcal{F}')^\bullet :
\mathcal{F} \to \bigoplus\nolimits_{j_0} \mathcal{F}'_{j_0} \to
\bigoplus\nolimits_{j_0 < j_1} \mathcal{F}'_{j_0j_1} \to \ldots
$$
and
$$
(\mathcal{F}'')^\bullet :
\mathcal{F} \to
\bigoplus\nolimits_{i_0} \mathcal{F}_{i_0} \oplus
\bigoplus\nolimits_{j_0} \mathcal{F}'_{j_0} \to
\bigoplus\nolimits_{i_0 < i_1} \mathcal{F}_{i_0i_1} \oplus
\bigoplus\nolimits_{i_0, j_0} \mathcal{F}''_{i_0, j_0} \oplus
\bigoplus\nolimits_{j_0 < j_1} \mathcal{F}'_{j_0j_1} \to
\ldots
$$
whose differentials are those used in defining
(\ref{equation-extended-alternating}).
There are maps of complexes
$$
(\mathcal{F}'')^\bullet \to \mathcal{F}^\bullet
\quad\text{and}\quad
(\mathcal{F}'')^\bullet \to (\mathcal{F}')^\bullet
$$
given by the projection maps on the terms (and hence inducing
the identity map in degree $0$). Observe that by
Lemma \ref{lemma-extended-alternating-represented}
each of these complexes represents
$i_*R\mathcal{H}_Z(\mathcal{F})$ and these maps
represent the identity on this object. Thus it suffices
to find an element
$$
\sigma \in H^c((\mathcal{F}'')^\bullet(X))
$$
mapping to $c_{f_1, \ldots, f_c}(s)$ and $\det(a_{ji})c_{g_1, \ldots, g_c}(s)$
by these two maps. It turns out we can explicitly give a cocycle
for $\sigma$. Namely, we take
$$
\sigma_{1 \ldots c} = \frac{s}{f_1 \ldots f_c} \in \mathcal{F}_{1 \ldots c}(X)
\quad\text{and}\quad
\sigma'_{1 \ldots c} = \frac{\det(a_{ji})s}{g_1 \ldots g_c} \in
\mathcal{F}'_{1 \ldots c}(X)
$$
and we take
$$
\sigma_{i_0 \ldots i_p, j_0 \ldots j_{c - p - 2}} =
\frac{\lambda(i_0 \ldots i_p, j_0 \ldots j_{c - p - 2})s}%
{f_{i_0} \ldots f_{i_p}g_{j_0} \ldots g_{j_{c - p - 2}}}
\in \mathcal{F}''_{i_0 \ldots i_p, j_0 \ldots j_{c - p - 2}}(X)
$$
where $\lambda(i_0 \ldots i_p, j_0 \ldots j_{c - p - 2})$
is the coefficient of $e_1 \wedge \ldots \wedge e_c$ in
the formal expression
$$
e_{i_0} \wedge \ldots \wedge e_{i_p} \wedge
(a_{j_01} e_1 + \ldots + a_{j_0c}e_c) \wedge \ldots \wedge
(a_{j_{c - p - 2}1} e_1 + \ldots + a_{j_{c - p - 2}c}e_c)
$$
To verify that $\sigma$ is a cocycle, we have to show for
$1 \leq i_0 < \ldots < i_p \leq c$ and
$1 \leq j_0 < \ldots < j_{c - p - 1} \leq c$
that we have
\begin{align*}
0 & =
\sum\nolimits_{a = 0, \ldots, p} (-1)^a
f_{i_a} \lambda(i_0 \ldots \hat i_a \ldots i_p, j_0 \ldots j_{c - p - 1}) \\
& +
\sum\nolimits_{b = 0, \ldots, c - p - 1} (-1)^{p + b + 1}g_{j_b}
\lambda(i_0 \ldots i_p, j_0 \ldots \hat j_b \ldots j_{c - p - 1})
\end{align*}
The easiest way to see this is perhaps to argue that the formal expression
$$
\xi = e_{i_0} \wedge \ldots \wedge e_{i_p} \wedge
(a_{j_01} e_1 + \ldots + a_{j_0c}e_c) \wedge \ldots \wedge
(a_{j_{c - p - 1}1} e_1 + \ldots + a_{j_{c - p - 1}c}e_c)
$$
is $0$ as it is an element of the $(c + 1)$st wedge power of the free module
on $e_1, \ldots, e_c$ and that the expression above is the image of
$\xi$ under the Koszul differential sending $e_i \to f_i$. Some details
omitted.
\end{proof}

\begin{lemma}
\label{lemma-supported-map-global}
Let $X$ be a scheme. Let $Z \to X$ be a closed immersion of finite presentation
whose conormal sheaf $\mathcal{C}_{Z/X}$ is locally free of rank $c$.
Then there is a canonical map
$$
c :
\wedge^c(\mathcal{C}_{Z/X})^\vee \otimes_{\mathcal{O}_Z} i^*\mathcal{F}
\longrightarrow
\mathcal{H}_Z^c(\mathcal{F})
$$
functorial in the quasi-coherent module $\mathcal{F}$.
\end{lemma}

\begin{proof}
Follows from the construction in
Remark \ref{remark-supported-map-c-equations}
and the independence of the choice
of generators of the ideal sheaf shown in
Lemma \ref{lemma-supported-map-determinant}.
Some details omitted.
\end{proof}

\begin{remark}
\label{remark-supported-functorial}
Let $g : X' \to X$ be a morphism of schemes. Let
$f_1, \ldots, f_c \in \Gamma(X, \mathcal{O}_X)$.
Set $f'_i = g^\sharp(f_i) \in \Gamma(X', \mathcal{O}_{X'})$.
Denote $Z \subset X$, resp.\ $Z' \subset X'$ the closed
subscheme cut out by $f_1, \ldots, f_c$, resp.\ $f'_1, \ldots, f'_c$.
Then $Z' = Z \times_X X'$. Denote $h : Z' \to Z$ the induced morphism
of schemes.
Let $\mathcal{F}$ be an $\mathcal{O}_X$-module.
Set $\mathcal{F}' = g^*\mathcal{F}$.
In this setting, if $\mathcal{F}$ is quasi-coherent, then the diagram
$$
\xymatrix{
(i')^{-1}\mathcal{O}_{X'} \otimes_{h^{-1}i^{-1}\mathcal{O}_X}
h^{-1}\mathcal{H}^c_Z(\mathcal{F}) \ar[r] &
\mathcal{H}_{Z'}^c(\mathcal{F}') \\
h^*i^*\mathcal{F} \ar[r] \ar[u]_-{c_{f_1, \ldots, f_c}} &
(i')^*\mathcal{F}' \ar[u]^-{c_{f'_1, \ldots, f'_c}}
}
$$
is commutative where the top horizontal arrow is
the map of Cohomology, Remark \ref{cohomology-remark-support-functorial}
on cohomology sheaves in degree $c$. Namely,
denote $\mathcal{F}^\bullet$, resp.\ $(\mathcal{F}')^\bullet$
the extended alternating {\v C}ech complex constructed in
Remark \ref{remark-support-c-equations}
using $\mathcal{F}, f_1, \ldots, f_c$,
resp.\ $\mathcal{F}', f'_1, \ldots, f'_c$.
Note that $(\mathcal{F}')^\bullet = g^*\mathcal{F}^\bullet$.
Then, without assuming $\mathcal{F}$ is quasi-coherent, the diagram
$$
\xymatrix{
i'_* L(g|_{Z'})^* R\mathcal{H}_Z(\mathcal{F}) \ar[r] \ar@{=}[d] &
i'_*R\mathcal{H}_{Z'}(Lg^*\mathcal{F}) \ar[d] \\
Lg^*i_*R\mathcal{H}_Z(\mathcal{F}) &
i'_*R\mathcal{H}_{Z'}(\mathcal{F}') \\
Lg^*(\mathcal{F}^\bullet) \ar[u] \ar[r] &
(\mathcal{F}')^\bullet \ar[u]
}
$$
is commutative where $g|_{Z'} : (Z', (i')^{-1}\mathcal{O}_{X'}) \to
(Z, i^{-1}\mathcal{O}_X)$ is the induced morphism of ringed spaces.
Here the top horizontal arrow is given in
Cohomology, Remark \ref{cohomology-remark-support-functorial}
as is the explanation for the equal sign.
The arrows pointing up are from
Remark \ref{remark-extended-alternating-map-to-support}.
The lower horizontal arrow is the map $Lg^*\mathcal{F}^\bullet
\to g^*\mathcal{F}^\bullet = (\mathcal{F}')^\bullet$ and the arrow
pointing down is induced by
$Lg^*\mathcal{F} \to g^*\mathcal{F} = \mathcal{F}'$.
The diagram commutes because going around the diagram both ways
we obtain two arrows $Lg^*\mathcal{F}^\bullet \to
i'_*R\mathcal{H}_{Z'}(\mathcal{F}')$ whose composition with
$i'_*R\mathcal{H}_{Z'}(\mathcal{F}') \to \mathcal{F}'$
is the canonical map $Lg^*\mathcal{F}^\bullet \to \mathcal{F}'$.
Some details omitted. Now the commutativity of the first diagram
follows by looking at this diagram on cohomology sheaves in degree
$c$ and using that the construction of the map
$i^*\mathcal{F} \to
\Coker(\bigoplus \mathcal{F}_{1 \ldots \hat i \ldots c} \to
\mathcal{F}_{1 \ldots c})$
used in Remark \ref{remark-supported-map-c-equations}
is compatible with pullbacks.
\end{remark}








\section{The coherator}
\label{section-coherator}

\noindent
Let $X$ be a scheme. The {\it coherator} is a functor
$$
Q_X :
\textit{Mod}(\mathcal{O}_X)
\longrightarrow
\QCoh(\mathcal{O}_X)
$$
which is right adjoint to the inclusion functor
$\QCoh(\mathcal{O}_X) \to \textit{Mod}(\mathcal{O}_X)$.
It exists for any scheme $X$ and moreover the adjunction mapping
$Q_X(\mathcal{F}) \to \mathcal{F}$ is an isomorphism for every
quasi-coherent module $\mathcal{F}$, see
Properties, Proposition \ref{properties-proposition-coherator}.
Since $Q_X$ is left exact (as a right adjoint) we can consider its
right derived extension
$$
RQ_X :
D(\mathcal{O}_X)
\longrightarrow
D(\QCoh(\mathcal{O}_X)).
$$
Since $Q_X$ is right adjoint to the inclusion functor
$\QCoh(\mathcal{O}_X) \to \textit{Mod}(\mathcal{O}_X)$
we see that $RQ_X$ is right adjoint to the canonical functor
$D(\QCoh(\mathcal{O}_X)) \to D(\mathcal{O}_X)$ by
Derived Categories, Lemma \ref{derived-lemma-derived-adjoint-functors}.

\medskip\noindent
In this section we will study the functor $RQ_X$. In
Section \ref{section-better-coherator}
we will study the (closely related) right adjoint to the inclusion functor
$D_\QCoh(\mathcal{O}_X) \to D(\mathcal{O}_X)$ (when it exists).

\begin{lemma}
\label{lemma-affine-pushforward}
Let $f : X \to Y$ be an affine morphism of schemes.
Then $f_*$ defines a derived functor
$f_* : D(\QCoh(\mathcal{O}_X)) \to D(\QCoh(\mathcal{O}_Y))$.
This functor has the property that
$$
\xymatrix{
D(\QCoh(\mathcal{O}_X)) \ar[d]_{f_*} \ar[r] &
D_\QCoh(\mathcal{O}_X) \ar[d]^{Rf_*} \\
D(\QCoh(\mathcal{O}_Y)) \ar[r] &
D_\QCoh(\mathcal{O}_Y)
}
$$
commutes.
\end{lemma}

\begin{proof}
The functor
$f_* : \QCoh(\mathcal{O}_X) \to \QCoh(\mathcal{O}_Y)$
is exact, see
Cohomology of Schemes, Lemma \ref{coherent-lemma-relative-affine-vanishing}.
Hence $f_*$ defines a derived functor
$f_* : D(\QCoh(\mathcal{O}_X)) \to D(\QCoh(\mathcal{O}_Y))$
by simply applying $f_*$ to any representative complex, see
Derived Categories, Lemma \ref{derived-lemma-right-derived-exact-functor}.
The diagram commutes by Lemma \ref{lemma-pushforward-affine-morphism}.
\end{proof}

\begin{lemma}
\label{lemma-flat-pushforward-coherator}
Let $f : X \to Y$ be a morphism of schemes. Assume $f$ is
quasi-compact, quasi-separated, and flat. Then, denoting
$$
\Phi : D(\QCoh(\mathcal{O}_X)) \to D(\QCoh(\mathcal{O}_Y))
$$
the right derived functor of
$f_* : \QCoh(\mathcal{O}_X) \to \QCoh(\mathcal{O}_Y)$
we have $RQ_Y \circ Rf_* = \Phi \circ RQ_X$.
\end{lemma}

\begin{proof}
We will prove this by showing that $RQ_Y \circ Rf_*$ and $\Phi \circ RQ_X$
are right adjoint to the same functor
$D(\QCoh(\mathcal{O}_Y)) \to D(\mathcal{O}_X)$.

\medskip\noindent
Since $f$ is quasi-compact and quasi-separated, we see that
$f_*$ preserves quasi-coherence, see
Schemes, Lemma \ref{schemes-lemma-push-forward-quasi-coherent}.
Recall that $\QCoh(\mathcal{O}_X)$ is a Grothendieck abelian category
(Properties, Proposition \ref{properties-proposition-coherator}).
Hence any $K$ in $D(\QCoh(\mathcal{O}_X))$
can be represented by a K-injective complex $\mathcal{I}^\bullet$
of $\QCoh(\mathcal{O}_X)$, see
Injectives, Theorem
\ref{injectives-theorem-K-injective-embedding-grothendieck}.
Then we can define $\Phi(K) = f_*\mathcal{I}^\bullet$.

\medskip\noindent
Since $f$ is flat, the functor $f^*$ is exact. Hence $f^*$ defines
$f^* : D(\mathcal{O}_Y) \to D(\mathcal{O}_X)$ and also
$f^* : D(\QCoh(\mathcal{O}_Y)) \to D(\QCoh(\mathcal{O}_X))$.
The functor $f^* = Lf^* : D(\mathcal{O}_Y) \to D(\mathcal{O}_X)$
is left adjoint to
$Rf_* : D(\mathcal{O}_X) \to D(\mathcal{O}_Y)$,
see Cohomology, Lemma \ref{cohomology-lemma-adjoint}.
Similarly, the functor
$f^* : D(\QCoh(\mathcal{O}_Y)) \to D(\QCoh(\mathcal{O}_X))$
is left adjoint to
$\Phi : D(\QCoh(\mathcal{O}_X)) \to D(\QCoh(\mathcal{O}_Y))$
by Derived Categories, Lemma \ref{derived-lemma-derived-adjoint-functors}.

\medskip\noindent
Let $A$ be an object of $D(\QCoh(\mathcal{O}_Y))$ and
$E$ an object of $D(\mathcal{O}_X)$. Then
\begin{align*}
\Hom_{D(\QCoh(\mathcal{O}_Y))}(A, RQ_Y(Rf_*E))
& =
\Hom_{D(\mathcal{O}_Y)}(A, Rf_*E) \\
& =
\Hom_{D(\mathcal{O}_X)}(f^*A, E) \\
& =
\Hom_{D(\QCoh(\mathcal{O}_X))}(f^*A, RQ_X(E)) \\
& =
\Hom_{D(\QCoh(\mathcal{O}_Y))}(A, \Phi(RQ_X(E)))
\end{align*}
This implies what we want.
\end{proof}

\begin{lemma}
\label{lemma-affine-coherator}
Let $X = \Spec(A)$ be an affine scheme. Then
\begin{enumerate}
\item $Q_X : \textit{Mod}(\mathcal{O}_X) \to \QCoh(\mathcal{O}_X)$
is the functor
which sends $\mathcal{F}$ to the quasi-coherent $\mathcal{O}_X$-module
associated to the $A$-module $\Gamma(X, \mathcal{F})$,
\item $RQ_X : D(\mathcal{O}_X) \to D(\QCoh(\mathcal{O}_X))$
is the functor which sends $E$ to the complex of quasi-coherent
$\mathcal{O}_X$-modules associated to the object $R\Gamma(X, E)$ of $D(A)$,
\item restricted to $D_\QCoh(\mathcal{O}_X)$ the functor
$RQ_X$ defines a quasi-inverse to (\ref{equation-compare}).
\end{enumerate}
\end{lemma}

\begin{proof}
The functor $Q_X$ is the functor
$$
\mathcal{F} \mapsto \widetilde{\Gamma(X, \mathcal{F})}
$$
by Schemes, Lemma \ref{schemes-lemma-compare-constructions}.
This immediately implies (1) and (2). The third assertion
follows from (the proof of)
Lemma \ref{lemma-affine-compare-bounded}.
\end{proof}

\noindent
At this point we are ready to prove a criterion
for when the functor $D(\QCoh(\mathcal{O}_X)) \to D_\QCoh(\mathcal{O}_X)$
is an equivalence.

\begin{lemma}
\label{lemma-argument-proves}
Let $X$ be a quasi-compact and quasi-separated scheme. Suppose that
for every affine open $U \subset X$ the right derived functor
$$
\Phi : D(\QCoh(\mathcal{O}_U)) \to D(\QCoh(\mathcal{O}_X))
$$
of the left exact functor
$j_* : \QCoh(\mathcal{O}_U) \to \QCoh(\mathcal{O}_X)$
fits into a commutative diagram
$$
\xymatrix{
D(\QCoh(\mathcal{O}_U)) \ar[d]_\Phi \ar[r]_{i_U} &
D_\QCoh(\mathcal{O}_U) \ar[d]^{Rj_*} \\
D(\QCoh(\mathcal{O}_X)) \ar[r]^{i_X} &
D_\QCoh(\mathcal{O}_X)
}
$$
Then the functor (\ref{equation-compare})
$$
D(\QCoh(\mathcal{O}_X))
\longrightarrow
D_\QCoh(\mathcal{O}_X)
$$
is an equivalence with quasi-inverse given by $RQ_X$.
\end{lemma}

\begin{proof}
Let $E$ be an object of $D_\QCoh(\mathcal{O}_X)$ and
let $A$ be an object of $D(\QCoh(\mathcal{O}_X))$.
We have to show that the adjunction maps
$$
A \to RQ_X(i_X(A))
\quad\text{and}\quad
i_X(RQ_X(E)) \to E
$$
are isomorphisms. Consider the hypothesis
$H_n$: the adjunction maps above are isomorphisms
whenever $E$ and $i_X(A)$ are supported
(Definition \ref{definition-supported-on})
on a closed subset of $X$ which
is contained in the union of $n$ affine opens of $X$.
We will prove $H_n$ by induction on $n$.

\medskip\noindent
Base case: $n = 0$. In this case $E = 0$, hence the map
$i_X(RQ_X(E)) \to E$ is an isomorphism. Similarly $i_X(A) = 0$.
Thus the cohomology sheaves of $i_X(A)$ are zero. Since the inclusion
functor $\QCoh(\mathcal{O}_X) \to \textit{Mod}(\mathcal{O}_X)$
is fully faithful and exact, we conclude that the cohomology
objects of $A$ are zero, i.e., $A = 0$ and
$A \to RQ_X(i_X(A))$ is an isomorphism as well.

\medskip\noindent
Induction step. Suppose that $E$ and $i_X(A)$ are supported on a
closed subset $T$ of $X$ contained in $U_1 \cup \ldots \cup U_n$
with $U_i \subset X$ affine open. Set $U = U_n$.
Consider the distinguished triangles
$$
A \to \Phi(A|_U) \to A' \to A[1]
\quad\text{and}\quad
E \to Rj_*(E|_U) \to E' \to E[1]
$$
where $\Phi$ is as in the statement of the lemma.
Note that $E \to Rj_*(E|_U)$ is a quasi-isomorphism over $U = U_n$.
Since $i_X \circ \Phi = Rj_* \circ i_U$ by assumption
and since $i_X(A)|_U = i_U(A|_U)$
we see that $i_X(A) \to i_X(\Phi(A|_U))$ is a quasi-isomorphism over $U$.
Hence $i_X(A')$ and $E'$ are supported on the closed
subset $T \setminus U$ of $X$ which is contained in
$U_1 \cup \ldots \cup U_{n - 1}$.
By induction hypothesis the statement is true for $A'$ and $E'$. By
Derived Categories, Lemma \ref{derived-lemma-third-isomorphism-triangle}
it suffices to prove the maps
$$
\Phi(A|_U) \to RQ_X(i_X(\Phi(A|_U)))
\quad\text{and}\quad
i_X(RQ_X(Rj_*E|_U)) \to Rj_*(E|_U)
$$
are isomorphisms. By assumption and by
Lemma \ref{lemma-flat-pushforward-coherator}
(the inclusion morphism $j : U \to X$ is flat, quasi-compact, and
quasi-separated) we have
$$
RQ_X(i_X(\Phi(A|_U))) = RQ_X(Rj_*(i_U(A|_U))) = \Phi(RQ_U(i_U(A|_U)))
$$
and
$$
i_X(RQ_X(Rj_*(E|_U))) = i_X(\Phi(RQ_U(E|_U))) = Rj_*(i_U(RQ_U(E|_U)))
$$
Finally, the maps
$$
A|_U \to RQ_U(i_U(A|_U))
\quad\text{and}\quad
i_U(RQ_U(E|_U)) \to E|_U
$$
are isomorphisms by Lemma \ref{lemma-affine-coherator}. The result follows.
\end{proof}

\begin{proposition}
\label{proposition-quasi-compact-affine-diagonal}
Let $X$ be a quasi-compact scheme with affine diagonal.
Then the functor (\ref{equation-compare})
$$
D(\QCoh(\mathcal{O}_X))
\longrightarrow
D_\QCoh(\mathcal{O}_X)
$$
is an equivalence with quasi-inverse given by $RQ_X$.
\end{proposition}

\begin{proof}
Let $U \subset X$ be an affine open. Then the morphism
$U \to X$ is affine by
Morphisms, Lemma \ref{morphisms-lemma-affine-permanence}.
Thus the assumption of Lemma \ref{lemma-argument-proves}
holds by Lemma \ref{lemma-affine-pushforward} and we win.
\end{proof}

\begin{lemma}
\label{lemma-direct-image-coherator}
Let $f : X \to Y$ be a morphism of schemes.
Assume $X$ and $Y$ are quasi-compact and have affine diagonal.
Then, denoting
$$
\Phi : D(\QCoh(\mathcal{O}_X)) \to D(\QCoh(\mathcal{O}_Y))
$$
the right derived functor of
$f_* : \QCoh(\mathcal{O}_X) \to \QCoh(\mathcal{O}_Y)$
the diagram
$$
\xymatrix{
D(\QCoh(\mathcal{O}_X)) \ar[d]_\Phi \ar[r] &
D_\QCoh(\mathcal{O}_X) \ar[d]^{Rf_*} \\
D(\QCoh(\mathcal{O}_Y)) \ar[r] &
D_\QCoh(\mathcal{O}_Y)
}
$$
is commutative.
\end{lemma}

\begin{proof}
Observe that the horizontal arrows in the diagram are
equivalences of categories by
Proposition \ref{proposition-quasi-compact-affine-diagonal}.
Hence we can identify these categories (and similarly for
other quasi-compact schemes with affine diagonal).
The statement of the lemma is that the canonical map
$\Phi(K) \to Rf_*(K)$ is an isomorphism for all $K$ in
$D(\QCoh(\mathcal{O}_X))$. Note that if $K_1 \to K_2 \to K_3 \to K_1[1]$
is a distinguished triangle in $D(\QCoh(\mathcal{O}_X))$ and
the statement is true for two-out-of-three, then it is true
for the third.

\medskip\noindent
Let $U \subset X$ be an affine open. Since the diagonal of $X$ is affine,
the inclusion morphism $j : U \to X$
is affine (Morphisms, Lemma \ref{morphisms-lemma-affine-permanence}).
Similarly, the composition $g = f \circ j : U \to Y$ is affine.
Let $\mathcal{I}^\bullet$ be a K-injective complex in $\QCoh(\mathcal{O}_U)$.
Since $j_* : \QCoh(\mathcal{O}_U) \to \QCoh(\mathcal{O}_X)$
has an exact left adjoint
$j^* : \QCoh(\mathcal{O}_X) \to \QCoh(\mathcal{O}_U)$
we see that $j_*\mathcal{I}^\bullet$ is a K-injective complex
in $\QCoh(\mathcal{O}_X)$, see
Derived Categories, Lemma \ref{derived-lemma-adjoint-preserve-K-injectives}.
It follows that
$$
\Phi(j_*\mathcal{I}^\bullet) =
f_*j_*\mathcal{I}^\bullet =
g_*\mathcal{I}^\bullet
$$
By Lemma \ref{lemma-affine-pushforward} we see that
$j_*\mathcal{I}^\bullet$ represents $Rj_*\mathcal{I}^\bullet$ and
$g_*\mathcal{I}^\bullet$ represents $Rg_*\mathcal{I}^\bullet$.
On the other hand, we have $Rf_* \circ Rj_* = Rg_*$.
Hence $f_*j_*\mathcal{I}^\bullet$ represents $Rf_*(j_*\mathcal{I}^\bullet)$.
We conclude that the lemma is true for any complex
of the form $j_*\mathcal{G}^\bullet$ with $\mathcal{G}^\bullet$
a complex of quasi-coherent modules on $U$. (Note that if
$\mathcal{G}^\bullet \to \mathcal{I}^\bullet$ is a quasi-isomorphism,
then $j_*\mathcal{G}^\bullet \to j_*\mathcal{I}^\bullet$ is a
quasi-isomorphism as well since $j_*$ is an exact functor
on quasi-coherent modules.)

\medskip\noindent
Let $\mathcal{F}^\bullet$ be a complex of quasi-coherent
$\mathcal{O}_X$-modules. Let $T \subset X$ be a closed subset
such that the support of $\mathcal{F}^p$ is contained in $T$
for all $p$. We will use induction on the minimal number $n$
of affine opens $U_1, \ldots, U_n$ such that
$T \subset U_1 \cup \ldots \cup U_n$. The base case $n = 0$ is trivial.
If $n \geq 1$, then set $U = U_1$ and denote $j : U \to X$ the
open immersion as above. We consider the map of complexes
$c : \mathcal{F}^\bullet \to j_*j^*\mathcal{F}^\bullet$.
We obtain two short exact sequences of complexes:
$$
0 \to \Ker(c) \to \mathcal{F}^\bullet \to \Im(c) \to 0
$$
and
$$
0 \to \Im(c) \to j_*j^*\mathcal{F}^\bullet \to \Coker(c) \to 0
$$
The complexes $\Ker(c)$ and $\Coker(c)$ are supported
on $T \setminus U \subset U_2 \cup \ldots \cup U_n$ and the result
holds for them by induction. The result holds for
$j_*j^*\mathcal{F}^\bullet$ by the discussion in the preceding
paragraph. We conclude by looking at the distinguished triangles
associated to the short exact sequences and using the initial
remark of the proof.
\end{proof}

\begin{remark}[Warning]
\label{remark-warning-coherator}
Let $X$ be a quasi-compact scheme with affine diagonal. Even though we know
that $D(\QCoh(\mathcal{O}_X)) = D_\QCoh(\mathcal{O}_X)$ by
Proposition \ref{proposition-quasi-compact-affine-diagonal}
strange things can
happen and it is easy to make mistakes with this material. One pitfall
is to carelessly assume that this equality means derived functors are the same.
For example, suppose we have a quasi-compact open $U \subset X$. Then we can
consider the higher right derived functors
$$
R^i(\QCoh)\Gamma(U, -) : \QCoh(\mathcal{O}_X) \to \textit{Ab}
$$
of the left exact functor $\Gamma(U, -)$. Since this is a universal
$\delta$-functor, and since the functors $H^i(U, -)$ (defined for all
abelian sheaves on $X$) restricted to $\QCoh(\mathcal{O}_X)$ form
a $\delta$-functor, we obtain canonical transformations
$$
t^i : R^i(\QCoh)\Gamma(U, -) \to H^i(U, -).
$$
These transformations aren't in general isomorphisms even if $X = \Spec(A)$
is affine! Namely, we have $R^1(\QCoh)\Gamma(U, \widetilde{I}) = 0$
if $I$ an injective $A$-module by construction of right derived functors
and the equivalence of $\QCoh(\mathcal{O}_X)$ and $\text{Mod}_A$.
But Examples, Lemma \ref{examples-lemma-nonvanishing}
shows there exists $A$, $I$, and $U$ such that
$H^1(U, \widetilde{I}) \not = 0$.
\end{remark}




\section{The coherator for Noetherian schemes}
\label{section-coherator-Noetherian}

\noindent
In the case of Noetherian schemes we can use the following lemma.

\begin{lemma}
\label{lemma-injective-quasi-coherent-sheaf-Noetherian}
Let $X$ be a Noetherian scheme. Let $\mathcal{J}$ be an injective
object of $\QCoh(\mathcal{O}_X)$. Then $\mathcal{J}$
is a flasque sheaf of $\mathcal{O}_X$-modules.
\end{lemma}

\begin{proof}
Let $U \subset X$ be an open subset and let $s \in \mathcal{J}(U)$ be a section.
Let $\mathcal{I} \subset \mathcal{O}_X$ be the quasi-coherent sheaf
of ideals defining the reduced induced scheme structure on $X \setminus U$
(see Schemes, Definition \ref{schemes-definition-reduced-induced-scheme}).
By Cohomology of Schemes, Lemma \ref{coherent-lemma-homs-over-open}
the section $s$ corresponds to a map $\sigma : \mathcal{I}^n \to \mathcal{J}$
for some $n$. As $\mathcal{J}$ is an injective object of
$\QCoh(\mathcal{O}_X)$ we can extend $\sigma$ to a map
$\tilde s : \mathcal{O}_X \to \mathcal{J}$. Then $\tilde s$ corresponds
to a global section of $\mathcal{J}$ restricting to $s$.
\end{proof}

\begin{lemma}
\label{lemma-Noetherian-pushforward}
Let $f : X \to Y$ be a morphism of Noetherian schemes.
Then $f_*$ on quasi-coherent sheaves has a right derived
extension
$\Phi : D(\QCoh(\mathcal{O}_X)) \to D(\QCoh(\mathcal{O}_Y))$
such that the diagram
$$
\xymatrix{
D(\QCoh(\mathcal{O}_X)) \ar[d]_{\Phi} \ar[r] &
D_\QCoh(\mathcal{O}_X) \ar[d]^{Rf_*} \\
D(\QCoh(\mathcal{O}_Y)) \ar[r] &
D_\QCoh(\mathcal{O}_Y)
}
$$
commutes.
\end{lemma}

\begin{proof}
Since $X$ and $Y$ are Noetherian schemes the morphism is quasi-compact
and quasi-separated (see
Properties, Lemma \ref{properties-lemma-locally-Noetherian-quasi-separated}
and
Schemes, Remark \ref{schemes-remark-quasi-compact-and-quasi-separated}).
Thus $f_*$ preserve quasi-coherence, see
Schemes, Lemma \ref{schemes-lemma-push-forward-quasi-coherent}.
Next, let $K$ be an object of $D(\QCoh(\mathcal{O}_X))$.
Since $\QCoh(\mathcal{O}_X)$ is a Grothendieck abelian category
(Properties, Proposition \ref{properties-proposition-coherator}), we can
represent $K$ by a K-injective complex $\mathcal{I}^\bullet$
such that each $\mathcal{I}^n$ is an injective object of
$\QCoh(\mathcal{O}_X)$, see
Injectives, Theorem
\ref{injectives-theorem-K-injective-embedding-grothendieck}.
Thus we see that the functor $\Phi$ is defined by setting
$$
\Phi(K) = f_*\mathcal{I}^\bullet
$$
where the right hand side is viewed as an object of
$D(\QCoh(\mathcal{O}_Y))$. To finish the proof of the lemma
it suffices to show that the canonical map
$$
f_*\mathcal{I}^\bullet \longrightarrow Rf_*\mathcal{I}^\bullet
$$
is an isomorphism in $D(\mathcal{O}_Y)$. To see this by
Lemma \ref{lemma-acyclicity-lemma}
it suffices to show that $\mathcal{I}^n$ is right
$f_*$-acyclic for all $n \in \mathbf{Z}$.
This is true because $\mathcal{I}^n$ is flasque by
Lemma \ref{lemma-injective-quasi-coherent-sheaf-Noetherian}
and flasque modules are right $f_*$-acyclic by
Cohomology, Lemma \ref{cohomology-lemma-flasque-acyclic-pushforward}.
\end{proof}

\begin{proposition}
\label{proposition-Noetherian}
Let $X$ be a Noetherian scheme. Then the functor (\ref{equation-compare})
$$
D(\QCoh(\mathcal{O}_X))
\longrightarrow
D_\QCoh(\mathcal{O}_X)
$$
is an equivalence with quasi-inverse given by $RQ_X$.
\end{proposition}

\begin{proof}
This follows from Lemma \ref{lemma-argument-proves} and
Lemma \ref{lemma-Noetherian-pushforward}.
\end{proof}






\section{Koszul complexes}
\label{section-koszul}

\noindent
Let $A$ be a ring and let $f_1, \ldots, f_r$ be a sequence of elements
of $A$. We have defined the Koszul complex
$K_\bullet(f_1, \ldots, f_r)$ in
More on Algebra, Definition \ref{more-algebra-definition-koszul-complex}.
It is a chain complex sitting in degrees $r, \ldots, 0$.
We turn this into a cochain complex $K^\bullet(f_1, \ldots, f_r)$
by setting $K^{-n}(f_1, \ldots, f_r) = K_n(f_1, \ldots, f_r)$
and using the same differentials. In the rest of this section all
the complexes will be cochain complexes.

\medskip\noindent
We define a complex $I^\bullet(f_1, \ldots, f_r)$
such that we have a distinguished triangle
$$
I^\bullet(f_1, \ldots, f_r) \to
A \to
K^\bullet(f_1, \ldots, f_r) \to
I^\bullet(f_1, \ldots, f_r)[1]
$$
in $K(A)$.
In other words, we set
$$
I^i(f_1, \ldots, f_r) =
\left\{
\begin{matrix}
K^{i - 1}(f_1, \ldots, f_r) & \text{if } i \leq 0 \\
0 & \text{else}
\end{matrix}
\right.
$$
and we use the negative of the differential on $K^\bullet(f_1, \ldots, f_r)$.
The maps in the distinguished triangle are the obvious ones. Note that
$I^0(f_1, \ldots, f_r) = A^{\oplus r} \to A$ is given by
multiplication by $f_i$ on the $i$th factor.
Hence $I^\bullet(f_1, \ldots, f_r) \to A$ factors as
$$
I^\bullet(f_1, \ldots, f_r) \to I \to A
$$
where $I = (f_1, \ldots, f_r)$. In fact, there is a short exact sequence
$$
0 \to H^{-1}(K^\bullet(f_1, \ldots, f_s)) \to
H^0(I^\bullet(f_1, \ldots, f_s)) \to I \to 0
$$
and for every $i < 0$ we have
$H^i(I^\bullet(f_1, \ldots, f_r)) = H^{i - 1}(K^\bullet(f_1, \ldots, f_r))$.
Observe that given a second sequence $g_1, \ldots, g_r$ of elements of $A$
there are canonical maps
$$
I^\bullet(f_1g_1, \ldots, f_rg_r) \to I^\bullet(f_1, \ldots, f_r)
\quad\text{and}\quad
K^\bullet(f_1g_1, \ldots, f_rg_r) \to K^\bullet(f_1, \ldots, f_r)
$$
compatible with the maps described above. The first of these maps is
given by multiplication by $g_i$ on the $i$th summand of
$I^0(f_1g_1, \ldots, f_rg_r) = A^{\oplus r}$. In particular, given
$f_1, \ldots, f_r$ we obtain an inverse system of complexes
\begin{equation}
\label{equation-system}
I^\bullet(f_1, \ldots, f_r) \leftarrow
I^\bullet(f_1^2, \ldots, f_r^2) \leftarrow
I^\bullet(f_1^3, \ldots, f_r^3) \leftarrow \ldots
\end{equation}
which will play an important role in that which is to follow.
To easily formulate the following lemmas we fix some notation.

\begin{situation}
\label{situation-complex}
Here $A$ is a ring and $f_1, \ldots, f_r$ is a sequence of elements of $A$.
We set $X = \Spec(A)$ and $U = D(f_1) \cup \ldots \cup D(f_r) \subset X$.
We denote $\mathcal{U} : U = \bigcup_{i = 1, \ldots, r} D(f_i)$ the
given open covering of $U$.
\end{situation}

\noindent
Our first lemma is that the complexes above can be used to compute
the cohomology of quasi-coherent sheaves on $U$.

\begin{lemma}
\label{lemma-alternating-cech-complex}
In Situation \ref{situation-complex}. Let $M$ be an $A$-module and
denote $\mathcal{F}$ the associated $\mathcal{O}_X$-module. Then
there is a canonical isomorphism of complexes
$$
\Psi : \colim_e \Hom_A(I^\bullet(f_1^e, \ldots, f_r^e), M)
\longrightarrow
\check{\mathcal{C}}_{alt}^\bullet(\mathcal{U}, \mathcal{F})
$$
functorial in $M$ where the differentials on the $\Hom$-complex
are the contragredients of the differentials on
$I^\bullet(f_1^e, \ldots, f_r^e)$.
\end{lemma}

\begin{proof}
Recall that the alternating {\v C}ech complex is the subcomplex
of the usual {\v C}ech complex given by alternating cochains, see
Cohomology, Section \ref{cohomology-section-alternating-cech}.
As usual we view a $p$-cochain in
$\check{\mathcal{C}}_{alt}^\bullet(\mathcal{U}, \mathcal{F})$
as an alternating function $s$ on $\{1, \ldots, r\}^{p + 1}$
whose value $s_{i_0\ldots i_p}$ at $(i_0, \ldots, i_p)$ lies in
$M_{f_{i_0}\ldots f_{i_p}} = \mathcal{F}(U_{i_0\ldots i_p})$.
On the other hand, a $p$-cochain $t$ in
$\Hom^\bullet(I^\bullet(f_1^e, \ldots, f_r^e), M)$
is a map $t : \wedge^{p + 1}(A^{\oplus r}) \to M$.
Write $[i] \in A^{\oplus r}$ for the $i$th basis element and
write
$$
[i_0, \ldots, i_p] = [i_0] \wedge \ldots \wedge [i_p]
\in \wedge^{p + 1}(A^{\oplus r})
$$
For $t$ as above we set
$$
\Psi(t)_{i_0 \ldots i_p} =
(-1)^p \frac{t([i_0, \ldots, i_p])}{f_{i_0}^e\ldots f_{i_p}^e}
$$
It is clear that $\Psi(t)$ is an alternating cochain.
The rule above is compatible with the transition maps
of the system as the transition map
$$
I^\bullet(f_1^e, \ldots, f_r^e) \leftarrow
I^\bullet(f_1^{e + 1}, \ldots, f_r^{e + 1}),
$$
of (\ref{equation-system}) sends $[i_0, \ldots, i_p]$
to $f_{i_0}\ldots f_{i_p}[i_0, \ldots, i_p]$.
It is clear from the description of the localizations
$M_{f_{i_0} \ldots f_{i_p}}$ in
Algebra, Lemma \ref{algebra-lemma-localization-colimit}
that the rule $\Psi$ defines an isomorphism of cochain modules
in degree $p$ in the colimit. To finish the proof we have to show that the map
is compatible with differentials. To see this, for $t$ as above we compute
\begin{align*}
d(\Psi(t))_{i_0 \ldots i_{p + 1}}
& =
\sum\nolimits_{j = 0}^{p + 1} (-1)^j
\Psi(t)_{i_0\ldots \hat i_j \ldots i_{p + 1}} \\
& =
(-1)^p
\sum\nolimits_{j = 0}^{p + 1} (-1)^j t([i_0 \ldots \hat i_j \ldots i_{p + 1}])
(f_{i_0} \ldots \hat f_{i_j} \ldots f_{i_p})^{-e}
\end{align*}
Recall that the differentials on $I^\bullet(f_1^e, \ldots, f_r^e)$
are the negative of the differentials on $K^\bullet(f_1, \ldots, f_r)$.
Thus
\begin{align*}
\Psi(d(t))_{i_0 \ldots i_{p + 1}} & =
(-1)^{p + 1}
d(t)([i_0, \ldots, i_{p + 1}]) (f_{i_0} \ldots f_{i_{p + 1}})^{-e} \\
& =
(-1)^{p + 1}
t(d([i_0, \ldots, i_{p + 1}])) (f_{i_0} \ldots f_{i_{p + 1}})^{-e} \\
& =
(-1)^{p + 1}
t(-\sum\nolimits_{j = 0}^{p + 1}
(-1)^j f_{i_j}^e [i_0, \ldots, \hat i_j, \ldots i_{p + 1}])
(f_{i_0} \ldots f_{i_{p + 1}})^{-e} \\
& =
-(-1)^{p + 1}
\sum\nolimits_{j = 0}^{p + 1}
(-1)^j t([i_0, \ldots, \hat i_j, \ldots i_{p + 1}])
(f_{i_0} \ldots \hat f_{i_j} \ldots f_{i_p})^{-e}
\end{align*}
The two formulas agree concluding the proof.
\end{proof}

\noindent
Suppose given a finite complex $I^\bullet$ of $A$-modules and a
complex of $A$-modules $M^\bullet$. Then we have the corresponding
Hom complex $\Hom^\bullet(I^\bullet, M^\bullet)$. This is a complex
with degree $n$ term given by
$$
\bigoplus\nolimits_{p + q = n} \Hom_A(I^{-q}, M^p)
$$
and differential as described in More on Algebra, Section
\ref{more-algebra-section-hom-complexes}.
As our complex $I^\bullet$ has only finitely many nonzero terms, the
direct sum displayed above is finite.
The conventions for taking the total complex associated to a
{\v C}ech complex of a complex are as in
Cohomology, Section \ref{cohomology-section-cech-cohomology-of-complexes}.

\begin{lemma}
\label{lemma-alternating-cech-complex-complex}
In Situation \ref{situation-complex}. Let $M^\bullet$ be a
complex of $A$-modules and
denote $\mathcal{F}^\bullet$ the associated complex of
$\mathcal{O}_X$-modules. Then
there is a canonical isomorphism of complexes
$$
\colim_e \Hom^\bullet(I^\bullet(f_1^e, \ldots, f_r^e), M^\bullet)
\longrightarrow
\text{Tot}(\check{\mathcal{C}}_{alt}^\bullet(\mathcal{U}, \mathcal{F}^\bullet))
$$
functorial in $M^\bullet$.
\end{lemma}

\begin{proof}
Consider the double complex $F^{\bullet, \bullet}$ with terms
$F^{p, q} = \mathcal{C}_{alt}^p(\mathcal{U}, \mathcal{F}^q)$
discussed in
Cohomology, Section \ref{cohomology-section-cech-cohomology-of-complexes}.
Consider the double complex $G^{\bullet, \bullet}$ with terms
$G^{p, q} = \colim_e \Hom_A(I^{-p}(f_1^e, \ldots, f_r^e), M^q)$ and
differentials given by functoriality (without the intervention
of signs). The maps $\psi^{p, q} : G^{p, q} \to F^{p, q}$
constructed in the proof of Lemma \ref{lemma-alternating-cech-complex}
are isomorphisms and compatible with the differentials $d_1$ (by the lemma)
and $d_2$ (this is clear). However, the differentials $d$ on the
complexes on the left and right hand side of the arrow in the lemma
have different signs. Namely, for $g \in G^{p, q}$ is given by
$$
d(g) =  d_2(g) - (-1)^{p + q} d_1(g) 
$$
(see More on Algebra, Section \ref{more-algebra-section-hom-complexes})
and the differential for $f \in F^{p, q}$ is given by
$$
d(f) = d_1(f) + (-1)^p d_2(f)
$$
Thus we can fix the signs by multiplying $\psi^{p, q}$ by
$(-1)^{pq + p(p - 1)/2}$.
\end{proof}

\begin{lemma}
\label{lemma-alternating-cech-complex-complex-computes-cohomology}
In Situation \ref{situation-complex}. Let $\mathcal{F}^\bullet$
be a complex of quasi-coherent $\mathcal{O}_X$-modules. Then
there is a canonical isomorphism
$$
\text{Tot}(\check{\mathcal{C}}_{alt}^\bullet(\mathcal{U}, \mathcal{F}^\bullet))
\longrightarrow
R\Gamma(U, \mathcal{F}^\bullet)
$$
in $D(A)$ functorial in $\mathcal{F}^\bullet$.
\end{lemma}

\begin{proof}
Let $\mathcal{B}$ be the set of affine opens of $U$. Since the higher
cohomology groups of a quasi-coherent module on an affine scheme are zero
(Cohomology of Schemes, Lemma
\ref{coherent-lemma-quasi-coherent-affine-cohomology-zero})
this is a special case of
Cohomology, Lemma \ref{cohomology-lemma-alternating-cech-complex-complex-ss}.
\end{proof}

\noindent
In Situation \ref{situation-complex} denote $I_e$ the object of
$D(\mathcal{O}_X)$ corresponding to the complex of $A$-modules
$I^\bullet(f_1^e, \ldots, f_r^e)$ via the equivalence of
Lemma \ref{lemma-affine-compare-bounded}. The maps
(\ref{equation-system}) give a system
$$
I_1 \leftarrow
I_2 \leftarrow
I_3 \leftarrow \ldots
$$
Moreover, there is a compatible system of maps $I_e \to \mathcal{O}_X$
which become isomorphisms when restricted to $U$. Thus we see that for
every object $E$ of $D(\mathcal{O}_X)$ there is a canonical map
\begin{equation}
\label{equation-comparison}
\colim_e \Hom_{D(\mathcal{O}_X)}(I_e, E) \longrightarrow H^0(U, E)
\end{equation}
constructed by sending a map $I_e \to E$ to its restriction to $U$
and using that
$\Hom_{D(\mathcal{O}_U)}(\mathcal{O}_U, E|_U) = H^0(U, E)$.

\begin{proposition}
\label{proposition-represent-cohomology-class-on-open}
In Situation \ref{situation-complex}. For every object $E$
of $D_\QCoh(\mathcal{O}_X)$ the map
(\ref{equation-comparison}) is an isomorphism.
\end{proposition}

\begin{proof}
By Lemma \ref{lemma-affine-compare-bounded} we may assume that $E$
is given by a complex of quasi-coherent sheaves $\mathcal{F}^\bullet$.
Let $M^\bullet = \Gamma(X, \mathcal{F}^\bullet)$ be the corresponding
complex of $A$-modules. By
Lemmas \ref{lemma-alternating-cech-complex-complex} and
\ref{lemma-alternating-cech-complex-complex-computes-cohomology}
we have quasi-isomorphisms
$$
\colim_e \Hom^\bullet(I^\bullet(f_1^e, \ldots, f_r^e), M^\bullet)
\longrightarrow
\text{Tot}(\check{\mathcal{C}}_{alt}^\bullet(\mathcal{U}, \mathcal{F}^\bullet))
\longrightarrow
R\Gamma(U, \mathcal{F}^\bullet)
$$
By More on Algebra, Lemma \ref{more-algebra-lemma-RHom-out-of-projective} and
Equation (\ref{more-algebra-equation-h0-RHom})
taking $H^0$ of the complex
$\Hom^\bullet(I^\bullet(f_1^e, \ldots, f_r^e), M^\bullet)$
computes $\Hom$ in $D(A)$. Thus taking $H^0$ on both sides we obtain
$$
\colim_e \Hom_{D(A)}(I^\bullet(f_1^e, \ldots, f_r^e), M^\bullet)
=
H^0(U, E)
$$
Since $\Hom_{D(A)}(I^\bullet(f_1^e, \ldots, f_r^e), M^\bullet) =
\Hom_{D(\mathcal{O}_X)}(I_e, E)$ by
Lemma \ref{lemma-affine-compare-bounded} the lemma follows.
\end{proof}

\noindent
In Situation \ref{situation-complex} denote $K_e$ the object of
$D(\mathcal{O}_X)$ corresponding to the complex of $A$-modules
$K^\bullet(f_1^e, \ldots, f_r^e)$ via the equivalence of
Lemma \ref{lemma-affine-compare-bounded}. Thus we have distinguished
triangles
$$
I_e \to \mathcal{O}_X \to K_e \to I_e[1]
$$
and a system
$$
K_1 \leftarrow
K_2 \leftarrow
K_3 \leftarrow \ldots
$$
compatible with the system $(I_e)$.
Moreover, there is a compatible system of maps
$$
K_e \to H^0(K_e) = \mathcal{O}_X/(f_1^e, \ldots, f_r^e)
$$

\begin{lemma}
\label{lemma-represent-cohomology-class-on-closed}
In Situation \ref{situation-complex}. Let $E$ be an object of
$D_\QCoh(\mathcal{O}_X)$.
Assume that $H^i(E)|_U = 0$ for $i = - r + 1, \ldots, 0$.
Then given $s \in H^0(X, E)$ there exists an $e \geq 0$ and
a morphism $K_e \to E$ such that $s$ is in the image of
$H^0(X, K_e) \to H^0(X, E)$.
\end{lemma}

\begin{proof}
Since $U$ is covered by $r$ affine opens we have $H^j(U, \mathcal{F}) = 0$
for $j \geq r$ and any quasi-coherent module
(Cohomology of Schemes, Lemma \ref{coherent-lemma-vanishing-nr-affines}).
By Lemma \ref{lemma-application-nice-K-injective} we see that $H^0(U, E)$
is equal to $H^0(U, \tau_{\geq -r + 1}E)$. There is
a spectral sequence
$$
H^j(U, H^i(\tau_{\geq -r + 1}E)) \Rightarrow H^{i + j}(U, \tau_{\geq -N}E)
$$
see Derived Categories, Lemma \ref{derived-lemma-two-ss-complex-functor}.
Hence $H^0(U, E) = 0$ by our assumed vanishing of cohomology sheaves of $E$.
We conclude that $s|_U = 0$.
Think of $s$ as a morphism $\mathcal{O}_X \to E$ in $D(\mathcal{O}_X)$.
By Proposition \ref{proposition-represent-cohomology-class-on-open}
the composition $I_e \to \mathcal{O}_X \to E$ is zero for some $e$.
By the distinguished triangle $I_e \to \mathcal{O}_X \to K_e \to I_e[1]$
we obtain a morphism $K_e \to E$ such that $s$ is the composition
$\mathcal{O}_X \to K_e \to E$.
\end{proof}


\section{Pseudo-coherent and perfect complexes}
\label{section-spell-out}

\noindent
In this section we make the connection between the general
notions defined in
Cohomology, Sections \ref{cohomology-section-strictly-perfect},
\ref{cohomology-section-pseudo-coherent},
\ref{cohomology-section-tor}, and
\ref{cohomology-section-perfect}
and the corresponding notions for complexes of modules in
More on Algebra, Sections
\ref{more-algebra-section-pseudo-coherent},
\ref{more-algebra-section-tor}, and
\ref{more-algebra-section-perfect}.

\begin{lemma}
\label{lemma-pseudo-coherent}
Let $X$ be a scheme. If $E$ is an $m$-pseudo-coherent
object of $D(\mathcal{O}_X)$, then $H^i(E)$ is a quasi-coherent
$\mathcal{O}_X$-module for $i > m$ and $H^m(E)$ is a quotient
of a quasi-coherent $\mathcal{O}_X$-module.
If $E$ is pseudo-coherent, then $E$ is an object of
$D_\QCoh(\mathcal{O}_X)$.
\end{lemma}

\begin{proof}
Locally on $X$ there exists a strictly perfect complex $\mathcal{E}^\bullet$
such that $H^i(E)$ is isomorphic to $H^i(\mathcal{E}^\bullet)$ for $i > m$
and $H^m(E)$ is a quotient of $H^m(\mathcal{E}^\bullet)$. The sheaves
$\mathcal{E}^i$ are direct summands of finite free modules,
hence quasi-coherent. The lemma follows.
\end{proof}

\begin{lemma}
\label{lemma-pseudo-coherent-affine}
Let $X = \Spec(A)$ be an affine scheme. Let $M^\bullet$ be a
complex of $A$-modules and let $E$ be the corresponding object
of $D(\mathcal{O}_X)$. Then $E$ is an $m$-pseudo-coherent
(resp.\ pseudo-coherent) as an object of $D(\mathcal{O}_X)$
if and only if $M^\bullet$ is $m$-pseudo-coherent (resp.\ pseudo-coherent)
as a complex of $A$-modules.
\end{lemma}

\begin{proof}
It is immediate from the definitions that if $M^\bullet$ is
$m$-pseudo-coherent, so is $E$. To prove the converse, assume
$E$ is $m$-pseudo-coherent. As $X = \Spec(A)$ is quasi-compact with
a basis for the topology given by standard opens, we can find a standard
open covering $X = D(f_1) \cup \ldots \cup D(f_n)$ and strictly
perfect complexes $\mathcal{E}_i^\bullet$ on $D(f_i)$ and
maps $\alpha_i : \mathcal{E}_i^\bullet \to E|_{U_i}$ inducing
isomorphisms on $H^j$ for $j > m$ and surjections on $H^m$.
By Cohomology, Lemma \ref{cohomology-lemma-local-actual}
after refining the open covering
we may assume $\alpha_i$ is given by a map of complexes
$\mathcal{E}_i^\bullet \to \widetilde{M^\bullet}|_{U_i}$
for each $i$. By Modules, Lemma
\ref{modules-lemma-direct-summand-of-locally-free-is-locally-free}
the terms $\mathcal{E}_i^n$ are finite locally free modules.
Hence after refining the open covering we may assume each
$\mathcal{E}_i^n$ is a finite free $\mathcal{O}_{U_i}$-module.
From the definition it follows that $M^\bullet_{f_i}$ is
an $m$-pseudo-coherent complex of $A_{f_i}$-modules.
We conclude by applying
More on Algebra, Lemma \ref{more-algebra-lemma-glue-pseudo-coherent}.

\medskip\noindent
The case ``pseudo-coherent'' follows from the fact that $E$ is
pseudo-coherent if and only if $E$ is $m$-pseudo-coherent for
all $m$ (by definition) and the same is true for $M^\bullet$
by More on Algebra, Lemma \ref{more-algebra-lemma-pseudo-coherent}.
\end{proof}

\begin{lemma}
\label{lemma-identify-pseudo-coherent-noetherian}
Let $X$ be a Noetherian scheme. Let $E$ be an object of
$D_\QCoh(\mathcal{O}_X)$. For $m \in \mathbf{Z}$ the
following are equivalent
\begin{enumerate}
\item $H^i(E)$ is coherent for $i \geq m$ and zero for $i \gg 0$, and
\item $E$ is $m$-pseudo-coherent.
\end{enumerate}
In particular, $E$ is pseudo-coherent if and only if $E$ is an object
of $D^-_{\textit{Coh}}(\mathcal{O}_X)$.
\end{lemma}

\begin{proof}
As $X$ is quasi-compact we see that in both (1) and (2) the object $E$
is bounded above. Thus the question is local on $X$ and we may assume
$X$ is affine. Say $X = \Spec(A)$ for some Noetherian ring $A$.
In this case $E$ corresponds to a complex of $A$-modules $M^\bullet$
by Lemma \ref{lemma-affine-compare-bounded}. By
Lemma \ref{lemma-pseudo-coherent-affine}
we see that $E$ is $m$-pseudo-coherent if and only if $M^\bullet$
is $m$-pseudo-coherent. On the other hand, $H^i(E)$ is coherent
if and only if $H^i(M^\bullet)$ is a finite $A$-module
(Properties, Lemma \ref{properties-lemma-finite-type-module}).
Thus the result follows from More on Algebra, Lemma
\ref{more-algebra-lemma-Noetherian-pseudo-coherent}.
\end{proof}

\begin{lemma}
\label{lemma-tor-dimension-affine}
Let $X = \Spec(A)$ be an affine scheme. Let $M^\bullet$ be a
complex of $A$-modules and let $E$ be the corresponding object
of $D(\mathcal{O}_X)$. Then
\begin{enumerate}
\item $E$ has tor amplitude in $[a, b]$ if and only if $M^\bullet$
has tor amplitude in $[a, b]$.
\item $E$ has finite tor dimension if and only if $M^\bullet$
has finite tor dimension.
\end{enumerate}
\end{lemma}

\begin{proof}
Part (2) follows trivially from part (1). In the proof of (1) we will
use the equivalence $D(A) = D_\QCoh(X)$ of
Lemma \ref{lemma-affine-compare-bounded}
without further mention.
Assume $M^\bullet$ has tor amplitude in $[a, b]$. Then $K^\bullet$
is isomorphic in $D(A)$ to a complex $K^\bullet$ of flat $A$-modules
with $K^i = 0$ for $i \not \in [a, b]$, see
More on Algebra, Lemma \ref{more-algebra-lemma-tor-amplitude}.
Then $E$ is isomorphic to $\widetilde{K^\bullet}$. Since each
$\widetilde{K^i}$ is a flat $\mathcal{O}_X$-module, we see
that $E$ has tor amplitude in $[a, b]$ by
Cohomology, Lemma \ref{cohomology-lemma-tor-amplitude}.

\medskip\noindent
Assume that $E$ has tor amplitude in $[a, b]$. Then $E$ is bounded
whence $M^\bullet$ is in $K^-(A)$. Thus we may replace $M^\bullet$
by a bounded above complex of $A$-modules. We may even choose
a projective resolution and assume that $M^\bullet$ is a bounded above
complex of free $A$-modules. Then for any $A$-module $N$ we have
$$
E \otimes_{\mathcal{O}_X}^\mathbf{L} \widetilde{N}
\cong
\widetilde{M^\bullet} \otimes_{\mathcal{O}_X}^\mathbf{L} \widetilde{N}
\cong
\widetilde{M^\bullet \otimes_A N}
$$
in $D(\mathcal{O}_X)$. Thus the vanishing of cohomology sheaves of
the left hand side implies $M^\bullet$ has tor amplitude in $[a, b]$.
\end{proof}

\begin{lemma}
\label{lemma-tor-dimension-rel-affine}
Let $f : X \to S$ be a morphism of affine schemes corresponding
to the ring map $R \to A$. Let $M^\bullet$ be a
complex of $A$-modules and let $E$ be the corresponding object
of $D(\mathcal{O}_X)$. Then
\begin{enumerate}
\item $E$ as an object of $D(f^{-1}\mathcal{O}_S)$ has tor amplitude in
$[a, b]$ if and only if $M^\bullet$ has tor amplitude in $[a, b]$
as an object of $D(R)$.
\item $E$ locally has finite tor dimension as an object of
$D(f^{-1}\mathcal{O}_S)$ if and only if $M^\bullet$
has finite tor dimension as an object of $D(R)$.
\end{enumerate}
\end{lemma}

\begin{proof}
Consider a prime $\mathfrak q \subset A$ lying over $\mathfrak p \subset R$.
Let $x \in X$ and $s = f(x) \in S$ be the corresponding points.
Then $(f^{-1}\mathcal{O}_S)_x = \mathcal{O}_{S, s} = R_\mathfrak p$
and $E_x = M^\bullet_\mathfrak q$. Keeping this in mind we can see
the equivalence as follows.

\medskip\noindent
If $M^\bullet$ has tor amplitude in $[a, b]$ as a complex of $R$-modules,
then the same is true for the localization of $M^\bullet$ at any prime of $A$.
Then we conclude by
Cohomology, Lemma \ref{cohomology-lemma-tor-amplitude-stalk}
that $E$ has tor amplitude in $[a, b]$ as a complex of sheaves
of $f^{-1}\mathcal{O}_S$-modules.
Conversely, assume that $E$ has tor amplitude in $[a, b]$
as an object of $D(f^{-1}\mathcal{O}_S)$.
We conclude (using the last cited lemma) that
$M^\bullet_\mathfrak q$ has tor amplitude in $[a, b]$
as a complex of $R_\mathfrak p$-modules for every
prime $\mathfrak q \subset A$ lying over $\mathfrak p \subset R$.
By More on Algebra, Lemma \ref{more-algebra-lemma-tor-amplitude-localization}
we find that $M^\bullet$ has tor amplitude in $[a, b]$
as a complex of $R$-modules.
This finishes the proof of (1).

\medskip\noindent
Since $X$ is quasi-compact, if $E$ locally has finite tor dimension
as a complex of $f^{-1}\mathcal{O}_S$-modules, then actually $E$
has tor amplitude in $[a, b]$ for some $a, b$ as a complex of
$f^{-1}\mathcal{O}_S$-modules. Thus (2) follows from (1).
\end{proof}

\begin{lemma}
\label{lemma-tor-qc-qs}
Let $X$ be a quasi-separated scheme. Let $E$ be an object
of $D_\QCoh(\mathcal{O}_X)$. Let $a \leq b$. The
following are equivalent
\begin{enumerate}
\item $E$ has tor amplitude in $[a, b]$, and
\item for all $\mathcal{F}$ in $\QCoh(\mathcal{O}_X)$
we have $H^i(E \otimes_{\mathcal{O}_X}^\mathbf{L} \mathcal{F}) = 0$
for $i \not \in [a, b]$.
\end{enumerate}
\end{lemma}

\begin{proof}
It is clear that (1) implies (2). Assume (2). Let $U \subset X$ be
an affine open. As $X$ is quasi-separated the morphism $j : U \to X$
is quasi-compact and separated, hence $j_*$ transforms quasi-coherent
modules into quasi-coherent modules
(Schemes, Lemma \ref{schemes-lemma-push-forward-quasi-coherent}).
Thus the functor
$\QCoh(\mathcal{O}_X) \to \QCoh(\mathcal{O}_U)$
is essentially surjective. It follows that condition (2)
implies the vanishing of
$H^i(E|_U \otimes_{\mathcal{O}_U}^\mathbf{L} \mathcal{G})$
for $i \not \in [a, b]$ for all quasi-coherent $\mathcal{O}_U$-modules
$\mathcal{G}$. Write $U = \Spec(A)$ and let $M^\bullet$ be the
complex of $A$-modules corresponding to $E|_U$ by
Lemma \ref{lemma-affine-compare-bounded}.
We have just shown that $M^\bullet \otimes_A^\mathbf{L} N$
has vanishing cohomology groups outside the range $[a, b]$,
in other words $M^\bullet$ has tor amplitude in $[a, b]$.
By Lemma \ref{lemma-tor-dimension-affine}
we conclude that $E|_U$ has tor amplitude in $[a, b]$.
This proves the lemma.
\end{proof}

\begin{lemma}
\label{lemma-perfect-affine}
Let $X = \Spec(A)$ be an affine scheme. Let $M^\bullet$ be a
complex of $A$-modules and let $E$ be the corresponding object
of $D(\mathcal{O}_X)$. Then $E$ is a perfect object of $D(\mathcal{O}_X)$
if and only if $M^\bullet$ is perfect as an object of $D(A)$.
\end{lemma}

\begin{proof}
This is a logical consequence of
Lemmas \ref{lemma-pseudo-coherent-affine} and
\ref{lemma-tor-dimension-affine},
Cohomology, Lemma \ref{cohomology-lemma-perfect}, and
More on Algebra, Lemma \ref{more-algebra-lemma-perfect}.
\end{proof}

\noindent
As a consequence of our description of pseudo-coherent
complexes on schemes we can prove certain internal homs
are quasi-coherent.

\begin{lemma}
\label{lemma-quasi-coherence-internal-hom}
Let $X$ be a scheme.
\begin{enumerate}
\item If $L$ is in $D^+_\QCoh(\mathcal{O}_X)$ and
$K$ in $D(\mathcal{O}_X)$ is pseudo-coherent, then
$R\SheafHom(K, L)$ is in $D_\QCoh(\mathcal{O}_X)$
and locally bounded below.
\item If $L$ is in $D_\QCoh(\mathcal{O}_X)$ and
$K$ in $D(\mathcal{O}_X)$ is perfect, then
$R\SheafHom(K, L)$ is in $D_\QCoh(\mathcal{O}_X)$.
\item If $X = \Spec(A)$ is affine and $K, L \in D(A)$ then
$$
R\SheafHom(\widetilde{K}, \widetilde{L}) = \widetilde{R\Hom_A(K, L)}
$$
in the following two cases
\begin{enumerate}
\item $K$ is pseudo-coherent and $L$ is bounded below,
\item $K$ is perfect and $L$ arbitrary.
\end{enumerate}
\item If $X = \Spec(A)$ and $K, L$ are in $D(A)$, then the $n$th
cohomology sheaf of $R\SheafHom(\widetilde{K}, \widetilde{L})$
is the sheaf associated to the presheaf
$$
X \supset D(f) \longmapsto \Ext^n_{A_f}(K \otimes_A A_f, L \otimes_A A_f)
$$
for $f \in A$.
\end{enumerate}
\end{lemma}

\begin{proof}
The construction of the internal hom in the derived category of
$\mathcal{O}_X$ commutes with localization (see
Cohomology, Section \ref{cohomology-section-internal-hom}).
Hence to prove (1) and (2) we may replace $X$ by an affine open.
By Lemmas \ref{lemma-affine-compare-bounded},
\ref{lemma-pseudo-coherent-affine}, and
\ref{lemma-perfect-affine}
in order to prove (1) and (2) it suffices to prove (3).

\medskip\noindent
Part (3) follows from the computation of the
internal hom of Cohomology, Lemma
\ref{cohomology-lemma-Rhom-complex-of-direct-summands-finite-free}
by representing $K$ by a bounded above (resp.\ finite) complex of
finite projective $A$-modules and $L$ by a bounded below
(resp.\ arbitrary) complex of $A$-modules.

\medskip\noindent
To prove (4) recall that on any ringed space the $n$th cohomology sheaf of
$R\SheafHom(A, B)$ is the sheaf associated to the presheaf
$$
U \mapsto \Hom_{D(U)}(A|_U, B|_U[n]) =
\Ext^n_{D(\mathcal{O}_U)}(A|_U, B|_U)
$$
See Cohomology, Section \ref{cohomology-section-internal-hom}.
On the other hand, the restriction of $\widetilde{K}$ to a principal
open $D(f)$ is the image of $K \otimes_A A_f$ and similarly for $L$.
Hence (4) follows from the equivalence of categories of
Lemma \ref{lemma-affine-compare-bounded}.
\end{proof}

\begin{lemma}
\label{lemma-internal-hom-evaluate-tensor-isomorphism}
Let $X$ be a scheme. Let $K, L, M$ be objects of $D_\QCoh(\mathcal{O}_X)$.
The map
$$
K \otimes_{\mathcal{O}_X}^\mathbf{L} R\SheafHom(M, L)
\longrightarrow
R\SheafHom(M, K \otimes_{\mathcal{O}_X}^\mathbf{L} L)
$$
of Cohomology, Lemma \ref{cohomology-lemma-internal-hom-diagonal-better}
is an isomorphism in the following cases
\begin{enumerate}
\item $M$ perfect, or
\item $K$ is perfect, or
\item $M$ is pseudo-coherent, $L \in D^+(\mathcal{O}_X)$, and $K$ has finite
tor dimension.
\end{enumerate}
\end{lemma}

\begin{proof}
Lemma \ref{lemma-quasi-coherence-internal-hom}
reduces cases (1) and (3) to the affine case which is treated in
More on Algebra, Lemma
\ref{more-algebra-lemma-internal-hom-evaluate-tensor-isomorphism}.
(You also have to use Lemmas \ref{lemma-pseudo-coherent-affine},
\ref{lemma-perfect-affine}, and \ref{lemma-tor-dimension-affine}
to do the translation into algebra.)
If $K$ is perfect but no other assumptions are made, then we
do not know that either side of the arrow is in $D_\QCoh(\mathcal{O}_X)$
but the result is still true because we can work locally and reduce
to the case that $K$ is a finite complex of finite free modules
in which case it is clear.
\end{proof}





\section{Derived category of coherent modules}
\label{section-derived-coherent}

\noindent
Let $X$ be a locally Noetherian scheme. In this case the category
$\textit{Coh}(\mathcal{O}_X) \subset \textit{Mod}(\mathcal{O}_X)$
of coherent $\mathcal{O}_X$-modules is a weak Serre subcategory, see
Homology, Section \ref{homology-section-serre-subcategories}
and
Cohomology of Schemes, Lemma \ref{coherent-lemma-coherent-abelian-Noetherian}.
Denote
$$
D_{\textit{Coh}}(\mathcal{O}_X) \subset D(\mathcal{O}_X)
$$
the subcategory of complexes whose cohomology sheaves are coherent, see
Derived Categories, Section \ref{derived-section-triangulated-sub}.
Thus we obtain a canonical functor
\begin{equation}
\label{equation-compare-coherent}
D(\textit{Coh}(\mathcal{O}_X))
\longrightarrow
D_{\textit{Coh}}(\mathcal{O}_X)
\end{equation}
see Derived Categories, Equation (\ref{derived-equation-compare}).

\begin{lemma}
\label{lemma-coh-to-qcoh}
Let $X$ be a Noetherian scheme. Then the functor
$$
D^-(\textit{Coh}(\mathcal{O}_X))
\longrightarrow
D^-_{\textit{Coh}(\mathcal{O}_X)}(\QCoh(\mathcal{O}_X))
$$
is an equivalence.
\end{lemma}

\begin{proof}
Observe that $\textit{Coh}(\mathcal{O}_X) \subset \QCoh(\mathcal{O}_X)$
is a Serre subcategory, see
Homology, Definition \ref{homology-definition-serre-subcategory} and
Lemma \ref{homology-lemma-characterize-serre-subcategory} and
Cohomology of Schemes, Lemmas
\ref{coherent-lemma-coherent-abelian-Noetherian} and
\ref{coherent-lemma-coherent-Noetherian-quasi-coherent-sub-quotient}.
On the other hand, if $\mathcal{G} \to \mathcal{F}$ is a surjection
from a quasi-coherent $\mathcal{O}_X$-module to a coherent
$\mathcal{O}_X$-module, then there exists a coherent submodule
$\mathcal{G}' \subset \mathcal{G}$ which surjects onto $\mathcal{F}$.
Namely, we can write $\mathcal{G}$ as the filtered union of its coherent
submodules by
Properties, Lemma \ref{properties-lemma-quasi-coherent-colimit-finite-type}
and then one of these will do the job.
Thus the lemma follows from
Derived Categories, Lemma \ref{derived-lemma-fully-faithful-embedding}.
\end{proof}

\begin{proposition}
\label{proposition-DCoh}
Let $X$ be a Noetherian scheme. Then the functors
$$
D^-(\textit{Coh}(\mathcal{O}_X))
\longrightarrow
D^-_{\textit{Coh}}(\mathcal{O}_X)
\quad\text{and}\quad
D^b(\textit{Coh}(\mathcal{O}_X))
\longrightarrow
D^b_{\textit{Coh}}(\mathcal{O}_X)
$$
are equivalences.
\end{proposition}

\begin{proof}
Consider the commutative diagram
$$
\xymatrix{
D^-(\textit{Coh}(\mathcal{O}_X)) \ar[r] \ar[d] &
D^-_{\textit{Coh}}(\mathcal{O}_X) \ar[d] \\
D^-(\QCoh(\mathcal{O}_X)) \ar[r] &
D^-_\QCoh(\mathcal{O}_X)
}
$$
By Lemma \ref{lemma-coh-to-qcoh} the left vertical arrow is fully faithful.
By Proposition \ref{proposition-Noetherian} the bottom arrow is an equivalence.
By construction the right vertical arrow is fully faithful.
We conclude that the top horizontal arrow is fully faithful.
If $K$ is an object of $D^-_{\textit{Coh}}(\mathcal{O}_X)$
then the object $K'$ of $D^-(\QCoh(\mathcal{O}_X))$ which corresponds
to it by Proposition \ref{proposition-Noetherian} will have
coherent cohomology sheaves. Hence $K'$ is in the essential
image of the left vertical arrow by Lemma \ref{lemma-coh-to-qcoh}
and we find that the top horizontal arrow is essentially surjective.
This finishes the proof for the bounded above case. The bounded
case follows immediately from the bounded above case.
\end{proof}

\begin{lemma}
\label{lemma-direct-image-coherent}
Let $S$ be a Noetherian scheme. Let $f : X \to S$ be a morphism of schemes
which is locally of finite type. Let $E$ be an object of
$D^b_{\textit{Coh}}(\mathcal{O}_X)$ such that the support of $H^i(E)$
is proper over $S$ for all $i$.
Then $Rf_*E$ is an object of $D^b_{\textit{Coh}}(\mathcal{O}_S)$.
\end{lemma}

\begin{proof}
Consider the spectral sequence
$$
R^pf_*H^q(E) \Rightarrow R^{p + q}f_*E
$$
see Derived Categories, Lemma \ref{derived-lemma-two-ss-complex-functor}.
By assumption and
Cohomology of Schemes, Lemma
\ref{coherent-lemma-support-proper-over-base-pushforward}
the sheaves $R^pf_*H^q(E)$ are coherent. Hence
$R^{p + q}f_*E$ is coherent, i.e., $Rf_*E \in D_{\textit{Coh}}(\mathcal{O}_S)$.
Boundedness from below is trivial. Boundedness from above
follows from
Cohomology of Schemes, Lemma
\ref{coherent-lemma-quasi-coherence-higher-direct-images}
or from
Lemma \ref{lemma-quasi-coherence-direct-image}.
\end{proof}

\begin{lemma}
\label{lemma-direct-image-coherent-bdd-below}
Let $S$ be a Noetherian scheme. Let $f : X \to S$ be a morphism of schemes
which is locally of finite type. Let $E$ be an object of
$D^+_{\textit{Coh}}(\mathcal{O}_X)$ such that the support of $H^i(E)$
is proper over $S$ for all $i$.
Then $Rf_*E$ is an object of $D^+_{\textit{Coh}}(\mathcal{O}_S)$.
\end{lemma}

\begin{proof}
The proof is the same as the proof of
Lemma \ref{lemma-direct-image-coherent}.
You can also deduce it from
Lemma \ref{lemma-direct-image-coherent}
by considering what the exact functor $Rf_*$ does to
the distinguished triangles
$\tau_{\leq a}E \to E \to \tau_{\geq a + 1}E \to \tau_{\leq a}E[1]$.
\end{proof}

\begin{lemma}
\label{lemma-coherent-internal-hom}
Let $X$ be a locally Noetherian scheme. If $L$ is in
$D^+_{\textit{Coh}}(\mathcal{O}_X)$ and $K$ in
$D^-_{\textit{Coh}}(\mathcal{O}_X)$, then
$R\SheafHom(K, L)$ is in $D^+_{\textit{Coh}}(\mathcal{O}_X)$.
\end{lemma}

\begin{proof}
It suffices to prove this when $X$ is the spectrum of
a Noetherian ring $A$.
By Lemma \ref{lemma-identify-pseudo-coherent-noetherian}
we see that $K$ is pseudo-coherent.
Then we can use Lemma \ref{lemma-quasi-coherence-internal-hom}
to translate the problem into the following algebra problem:
for $L \in D^+_{\textit{Coh}}(A)$ and $K$ in $D^-_{\textit{Coh}}(A)$, then
$R\Hom_A(K, L)$ is in $D^+_{\textit{Coh}}(A)$.
Since $L$ is bounded below and $K$ is bounded above there is a
convergent spectral sequence
$$
\Ext^p_A(K, H^q(L)) \Rightarrow \text{Ext}^{p + q}_A(K, L)
$$
and there are convergent spectral sequences
$$
\Ext^i_A(H^{-j}(K), H^q(L)) \Rightarrow \text{Ext}^{i + j}_A(K, H^q(L))
$$
See Injectives, Remarks \ref{injectives-remark-spectral-sequences-ext}
and \ref{injectives-remark-spectral-sequences-ext-variant}.
This finishes the proof as the modules $\Ext^p_A(M, N)$
are finite for finite $A$-modules $M$, $N$ by
Algebra, Lemma \ref{algebra-lemma-ext-noetherian}.
\end{proof}

\begin{lemma}
\label{lemma-perfect-on-noetherian}
Let $X$ be a Noetherian scheme. Let $E$ in $D(\mathcal{O}_X)$ be perfect.
Then
\begin{enumerate}
\item $E$ is in $D^b_{\textit{Coh}}(\mathcal{O}_X)$,
\item if $L$ is in $D_{\textit{Coh}}(\mathcal{O}_X)$ then
$E \otimes_{\mathcal{O}_X}^\mathbf{L} L$ and
$R\SheafHom_{\mathcal{O}_X}(E, L)$ are in
$D_{\textit{Coh}}(\mathcal{O}_X)$,
\item if $L$ is in $D^b_{\textit{Coh}}(\mathcal{O}_X)$ then
$E \otimes_{\mathcal{O}_X}^\mathbf{L} L$ and
$R\SheafHom_{\mathcal{O}_X}(E, L)$ are in
$D^b_{\textit{Coh}}(\mathcal{O}_X)$,
\item if $L$ is in $D^+_{\textit{Coh}}(\mathcal{O}_X)$ then
$E \otimes_{\mathcal{O}_X}^\mathbf{L} L$ and
$R\SheafHom_{\mathcal{O}_X}(E, L)$ are in
$D^+_{\textit{Coh}}(\mathcal{O}_X)$,
\item if $L$ is in $D^-_{\textit{Coh}}(\mathcal{O}_X)$ then
$E \otimes_{\mathcal{O}_X}^\mathbf{L} L$ and
$R\SheafHom_{\mathcal{O}_X}(E, L)$ are in
$D^-_{\textit{Coh}}(\mathcal{O}_X)$.
\end{enumerate}
\end{lemma}

\begin{proof}
Since $X$ is quasi-compact, each of these statements can be checked
over the members of any open covering of $X$.
Thus we may assume $E$ is represented by
a bounded complex $\mathcal{E}^\bullet$ of finite free modules, see
Cohomology, Lemma \ref{cohomology-lemma-perfect-on-locally-ringed}.
In this case each of the statements is clear as both
$R\SheafHom_{\mathcal{O}_X}(E, L)$
and $E \otimes_{\mathcal{O}_X}^\mathbf{L} L$ can be computed on the
level of complexes using $\mathcal{E}^\bullet$, see
Cohomology, Lemmas \ref{cohomology-lemma-Rhom-strictly-perfect} and
\ref{cohomology-lemma-bounded-flat-K-flat}. Some details omitted.
\end{proof}

\begin{lemma}
\label{lemma-ext-finite}
Let $A$ be a Noetherian ring. Let $X$ be a proper scheme over $A$.
For $L$ in
$D^+_{\textit{Coh}}(\mathcal{O}_X)$ and $K$ in
$D^-_{\textit{Coh}}(\mathcal{O}_X)$, the $A$-modules
$\Ext_{\mathcal{O}_X}^n(K, L)$ are finite.
\end{lemma}

\begin{proof}
Recall that
$$
\Ext_{\mathcal{O}_X}^n(K, L) =
H^n(X, R\SheafHom_{\mathcal{O}_X}(K, L)) =
H^n(\Spec(A), Rf_*R\SheafHom_{\mathcal{O}_X}(K, L))
$$
see Cohomology, Lemma \ref{cohomology-lemma-section-RHom-over-U}
and Cohomology, Section \ref{cohomology-section-Leray}.
Thus the result follows from
Lemmas \ref{lemma-coherent-internal-hom} and
\ref{lemma-direct-image-coherent-bdd-below}.
\end{proof}

\begin{lemma}
\label{lemma-perfect-on-regular}
Let $X$ be a locally Noetherian regular scheme. Then
every object of $D^b_{\textit{Coh}}(\mathcal{O}_X)$ is perfect.
If $X$ is quasi-compact, i.e., Noetherian regular,
then conversely every perfect object of
$D(\mathcal{O}_X)$ is in $D^b_{\textit{Coh}}(\mathcal{O}_X)$.
\end{lemma}

\begin{proof}
Let $K$ be an object of $D^b_{\textit{Coh}}(\mathcal{O}_X)$.
To check that $K$ is perfect, we may work affine locally on $X$
(see Cohomology, Section \ref{cohomology-section-perfect}).
Then $K$ is perfect by Lemma \ref{lemma-perfect-affine} and
More on Algebra, Lemma \ref{more-algebra-lemma-regular-perfect}.
The converse is Lemma \ref{lemma-perfect-on-noetherian}.
\end{proof}




\section{Descent finiteness properties of complexes}
\label{section-descent-finiteness}

\noindent
This section is the analogue of
Descent, Section \ref{descent-section-descent-finiteness}
for objects of the derived category of a scheme.
The easiest such result is probably the following.

\begin{lemma}
\label{lemma-tor-amplitude-descends}
Let $f : X \to Y$ be a surjective flat morphism of schemes
(or more generally locally ringed spaces).
Let $E \in D(\mathcal{O}_Y)$. Let $a, b \in \mathbf{Z}$.
Then $E$ has tor-amplitude in $[a, b]$ if and only if
$Lf^*E$ has tor-amplitude in $[a, b]$.
\end{lemma}

\begin{proof}
Pullback always preserves tor-amplitude, see
Cohomology, Lemma \ref{cohomology-lemma-tor-amplitude-pullback}.
We may check tor-amplitude in $[a, b]$ on stalks, see
Cohomology, Lemma \ref{cohomology-lemma-tor-amplitude-stalk}.
A flat local ring homomorphism is faithfully flat by
Algebra, Lemma \ref{algebra-lemma-local-flat-ff}.
Thus the result follows from
More on Algebra, Lemma
\ref{more-algebra-lemma-flat-descent-tor-amplitude}.
\end{proof}

\begin{lemma}
\label{lemma-pseudo-coherent-descends-fpqc}
Let $\{f_i : X_i \to X\}$ be an fpqc covering of schemes. Let
$E \in D_\QCoh(\mathcal{O}_X)$. Let $m \in \mathbf{Z}$.
Then $E$ is $m$-pseudo-coherent if and only if each
$Lf_i^*E$ is $m$-pseudo-coherent.
\end{lemma}

\begin{proof}
Pullback always preserves $m$-pseudo-coherence, see
Cohomology, Lemma \ref{cohomology-lemma-pseudo-coherent-pullback}.
Conversely, assume that $Lf_i^*E$ is $m$-pseudo-coherent for all $i$.
Let $U \subset X$ be an affine open. It suffices to prove that
$E|_U$ is $m$-pseudo-coherent. Since $\{f_i : X_i \to X\}$ is an
fpqc covering, we can find finitely many affine open $V_j \subset X_{a(j)}$
such that $f_{a(j)}(V_j) \subset U$ and $U = \bigcup f_{a(j)}(V_j)$.
Set $V = \coprod V_i$.
Thus we may replace $X$ by $U$ and $\{f_i : X_i \to X\}$ by
$\{V \to U\}$ and assume that $X$ is affine and our covering
is given by a single surjective flat morphism $\{f : Y \to X\}$
of affine schemes. In this case the result follows from
More on Algebra, Lemma \ref{more-algebra-lemma-flat-descent-pseudo-coherent}
via Lemmas \ref{lemma-affine-compare-bounded} and
\ref{lemma-pseudo-coherent-affine}.
\end{proof}

\begin{lemma}
\label{lemma-pseudo-coherent-descends-fppf}
Let $\{f_i : X_i \to X\}$ be an fppf covering of schemes. Let
$E \in D(\mathcal{O}_X)$. Let $m \in \mathbf{Z}$.
Then $E$ is $m$-pseudo-coherent if and only if each
$Lf_i^*E$ is $m$-pseudo-coherent.
\end{lemma}

\begin{proof}
Pullback always preserves $m$-pseudo-coherence, see
Cohomology, Lemma \ref{cohomology-lemma-pseudo-coherent-pullback}.
Conversely, assume that $Lf_i^*E$ is $m$-pseudo-coherent for all $i$.
Let $U \subset X$ be an affine open. It suffices to prove that
$E|_U$ is $m$-pseudo-coherent. Since $\{f_i : X_i \to X\}$ is an
fppf covering, we can find finitely many affine open $V_j \subset X_{a(j)}$
such that $f_{a(j)}(V_j) \subset U$ and $U = \bigcup f_{a(j)}(V_j)$.
Set $V = \coprod V_i$.
Thus we may replace $X$ by $U$ and $\{f_i : X_i \to X\}$ by
$\{V \to U\}$ and assume that $X$ is affine and our covering
is given by a single surjective flat morphism $\{f : Y \to X\}$
of finite presentation.

\medskip\noindent
Since $f$ is flat the derived functor $Lf^*$ is just given by $f^*$ and $f^*$
is exact. Hence $H^i(Lf^*E) = f^*H^i(E)$. Since $Lf^*E$ is $m$-pseudo-coherent,
we see that $Lf^*E \in D^-(\mathcal{O}_Y)$. Since $f$ is surjective and flat,
we see that $E \in D^-(\mathcal{O}_X)$. Let $i \in \mathbf{Z}$ be the largest
integer such that $H^i(E)$ is nonzero. If $i < m$, then we are done. Otherwise,
$f^*H^i(E)$ is a finite type $\mathcal{O}_Y$-module by
Cohomology, Lemma \ref{cohomology-lemma-finite-cohomology}.
Then by Descent, Lemma \ref{descent-lemma-finite-type-descends-fppf}
the $\mathcal{O}_X$-module $H^i(E)$ is of finite type.
Thus, after replacing $X$ by the members of a finite affine open covering,
we may assume there exists a map
$$
\alpha : \mathcal{O}_X^{\oplus n}[-i] \longrightarrow E
$$
such that $H^i(\alpha)$ is a surjection. Let $C$ be the cone of $\alpha$
in $D(\mathcal{O}_X)$. Pulling back to $Y$ and using
Cohomology, Lemma \ref{cohomology-lemma-cone-pseudo-coherent}
we find that $Lf^*C$ is $m$-pseudo-coherent. Moreover $H^j(C) = 0$
for $j \geq i$. Thus by induction on $i$ we see that $C$ is
$m$-pseudo-coherent. Using
Cohomology, Lemma \ref{cohomology-lemma-cone-pseudo-coherent}
again we conclude.
\end{proof}

\begin{lemma}
\label{lemma-perfect-descends-fpqc}
Let $\{f_i : X_i \to X\}$ be an fpqc covering of schemes. Let
$E \in D(\mathcal{O}_X)$. Then $E$ is perfect
if and only if each $Lf_i^*E$ is perfect.
\end{lemma}

\begin{proof}
Pullback always preserves perfect complexes, see
Cohomology, Lemma \ref{cohomology-lemma-perfect-pullback}.
Conversely, assume that $Lf_i^*E$ is perfect for all $i$.
Then the cohomology sheaves of each $Lf_i^*E$ are quasi-coherent, see
Lemma \ref{lemma-pseudo-coherent}
and
Cohomology, Lemma \ref{cohomology-lemma-perfect}.
Since the morphisms $f_i$ is flat we see that $H^p(Lf_i^*E) = f_i^*H^p(E)$.
Thus the cohomology sheaves of $E$ are quasi-coherent by
Descent, Proposition \ref{descent-proposition-fpqc-descent-quasi-coherent}.
Having said this the lemma follows formally from
Cohomology, Lemma \ref{cohomology-lemma-perfect}
and
Lemmas \ref{lemma-tor-amplitude-descends} and
\ref{lemma-pseudo-coherent-descends-fpqc}.
\end{proof}

\begin{lemma}
\label{lemma-closed-push-pseudo-coherent}
Let $i : Z \to X$ be a morphism of ringed spaces such that
$i$ is a closed immersion of underlying topological spaces and such that
$i_*\mathcal{O}_Z$ is pseudo-coherent as an $\mathcal{O}_X$-module.
Let $E \in D(\mathcal{O}_Z)$. Then $E$ is $m$-pseudo-coherent
if and only if $Ri_*E$ is $m$-pseudo-coherent.
\end{lemma}

\begin{proof}
Throughout this proof we will use that $i_*$ is an exact functor, and
hence that $Ri_* = i_*$, see Modules, Lemma \ref{modules-lemma-i-star-exact}.

\medskip\noindent
Assume $E$ is $m$-pseudo-coherent. Let $x \in X$. We will find a neighbourhood
of $x$ such that $i_*E$ is $m$-pseudo-coherent on it. If $x \not \in Z$
then this is clear. Thus we may assume $x \in Z$. We will use
that $U \cap Z$ for $x \in U \subset X$ open form a fundamental system of
neighbourhoods of $x$ in $Z$. After shrinking $X$ we may assume $E$ is
bounded above. We will argue by induction on
the largest integer $p$ such that $H^p(E)$ is nonzero. If $p < m$, then
there is nothing to prove. If $p \geq m$, then $H^p(E)$ is an
$\mathcal{O}_Z$-module of finite type, see
Cohomology, Lemma \ref{cohomology-lemma-finite-cohomology}.
Thus we may choose, after shrinking $X$, a map
$\mathcal{O}_Z^{\oplus n}[-p] \to E$ which induces a surjection
$\mathcal{O}_Z^{\oplus n} \to H^p(E)$. Choose a distinguished triangle
$$
\mathcal{O}_Z^{\oplus n}[-p] \to E \to C \to \mathcal{O}_Z^{\oplus n}[-p + 1]
$$
We see that $H^j(C) = 0$ for $j \geq p$ and that $C$ is $m$-pseudo-coherent
by Cohomology, Lemma \ref{cohomology-lemma-cone-pseudo-coherent}.
By induction we see that $i_*C$ is $m$-pseudo-coherent on $X$.
Since $i_*\mathcal{O}_Z$ is $m$-pseudo-coherent on $X$ as well, we conclude
from the distinguished triangle
$$
i_*\mathcal{O}_Z^{\oplus n}[-p] \to i_*E \to i_*C \to
i_*\mathcal{O}_Z^{\oplus n}[-p + 1]
$$
and 
Cohomology, Lemma \ref{cohomology-lemma-cone-pseudo-coherent}
that $i_*E$ is $m$-pseudo-coherent.

\medskip\noindent
Assume that $i_*E$ is $m$-pseudo-coherent. Let $z \in Z$.
We will find a neighbourhood of $z$ such that $E$
is $m$-pseudo-coherent on it. We will use
that $U \cap Z$ for $z \in U \subset X$ open form a fundamental system of
neighbourhoods of $z$ in $Z$. After shrinking $X$ we may assume $i_*E$
and hence $E$ is bounded above. We will argue by induction on
the largest integer $p$ such that $H^p(E)$ is nonzero. If $p < m$, then
there is nothing to prove. If $p \geq m$, then $H^p(i_*E) = i_*H^p(E)$
is an $\mathcal{O}_X$-module of finite type, see
Cohomology, Lemma \ref{cohomology-lemma-finite-cohomology}.
Choose a complex $\mathcal{E}^\bullet$ of $\mathcal{O}_Z$-modules
representing $E$. We may choose, after shrinking $X$,
a map $\alpha : \mathcal{O}_X^{\oplus n}[-p] \to i_*\mathcal{E}^\bullet$
which induces a surjection
$\mathcal{O}_X^{\oplus n} \to i_*H^p(\mathcal{E}^\bullet)$.
By adjunction we find a map
$\alpha : \mathcal{O}_Z^{\oplus n}[-p] \to \mathcal{E}^\bullet$
which induces a surjection
$\mathcal{O}_Z^{\oplus n} \to H^p(\mathcal{E}^\bullet)$.
Choose a distinguished triangle
$$
\mathcal{O}_Z^{\oplus n}[-p] \to E \to C \to \mathcal{O}_Z^{\oplus n}[-p + 1]
$$
We see that $H^j(C) = 0$ for $j \geq p$. From the distinguished triangle
$$
i_*\mathcal{O}_Z^{\oplus n}[-p] \to i_*E \to i_*C \to
i_*\mathcal{O}_Z^{\oplus n}[-p + 1]
$$
the fact that $i_*\mathcal{O}_Z$ is pseudo-coherent
and 
Cohomology, Lemma \ref{cohomology-lemma-cone-pseudo-coherent}
we conclude that $i_*C$ is $m$-pseudo-coherent.
By induction we conclude that $C$ is $m$-pseudo-coherent.
By Cohomology, Lemma \ref{cohomology-lemma-cone-pseudo-coherent}
again we conclude that $E$ is $m$-pseudo-coherent.
\end{proof}

\begin{lemma}
\label{lemma-finite-push-pseudo-coherent}
Let $f : X \to Y$ be a finite morphism of schemes such that
$f_*\mathcal{O}_X$ is pseudo-coherent as an
$\mathcal{O}_Y$-module\footnote{This means that $f$ is pseudo-coherent, see
More on Morphisms, Lemma
\ref{more-morphisms-lemma-finite-pseudo-coherent}.}.
Let $E \in D_\QCoh(\mathcal{O}_X)$. Then $E$ is $m$-pseudo-coherent
if and only if $Rf_*E$ is $m$-pseudo-coherent.
\end{lemma}

\begin{proof}
This is a translation of
More on Algebra, Lemma \ref{more-algebra-lemma-finite-push-pseudo-coherent}
into the language of schemes. To do the translation, use
Lemmas \ref{lemma-affine-compare-bounded} and
\ref{lemma-pseudo-coherent-affine}.
\end{proof}


\section{Lifting complexes}
\label{section-lift}

\noindent
Let $U \subset X$ be an open subspace of a ringed space
and denote $j : U \to X$ the inclusion morphism. The functor
$D(\mathcal{O}_X) \to D(\mathcal{O}_U)$ is essentially surjective as
$Rj_*$ is a right inverse to restriction.
In this section we extend this to complexes with quasi-coherent cohomology
sheaves, etc.

\begin{lemma}
\label{lemma-lift-quasi-coherent}
Let $X$ be a scheme and let $j : U \to X$ be a quasi-compact
open immersion. The functors
$$
D_\QCoh(\mathcal{O}_X) \to D_\QCoh(\mathcal{O}_U)
\quad\text{and}\quad
D^+_\QCoh(\mathcal{O}_X) \to D^+_\QCoh(\mathcal{O}_U)
$$
are essentially surjective. If $X$ is quasi-compact, then the functors
$$
D^-_\QCoh(\mathcal{O}_X) \to D^-_\QCoh(\mathcal{O}_U)
\quad\text{and}\quad
D^b_\QCoh(\mathcal{O}_X) \to D^b_\QCoh(\mathcal{O}_U)
$$
are essentially surjective.
\end{lemma}

\begin{proof}
The argument preceding the lemma applies for the first case because $Rj_*$
maps $D_\QCoh(\mathcal{O}_U)$ into $D_\QCoh(\mathcal{O}_X)$
by Lemma \ref{lemma-quasi-coherence-direct-image}.
It is clear that $Rj_*$ maps
$D^+_\QCoh(\mathcal{O}_U)$ into
$D^+_\QCoh(\mathcal{O}_X)$
which implies the statement on bounded below complexes.
Finally, Lemma \ref{lemma-quasi-coherence-direct-image}
guarantees that $Rj_*$ maps
$D^-_\QCoh(\mathcal{O}_U)$ into
$D^-_\QCoh(\mathcal{O}_X)$
if $X$ is quasi-compact. Combining these two we obtain the last statement.
\end{proof}

\begin{lemma}
\label{lemma-lift-coherent}
Let $X$ be a Noetherian scheme and let $j : U \to X$ be an open immersion.
The functor
$D^b_{\textit{Coh}}(\mathcal{O}_X) \to D^b_{\textit{Coh}}(\mathcal{O}_U)$
is essentially surjective.
\end{lemma}

\begin{proof}
Let $K$ be an object of $D^b_{\textit{Coh}}(\mathcal{O}_U)$.
By Proposition \ref{proposition-DCoh} we can represent $K$ by a bounded
complex $\mathcal{F}^\bullet$ of coherent $\mathcal{O}_U$-modules.
Say $\mathcal{F}^i = 0$ for $i \not \in [a, b]$ for some $a \leq b$.
Since $j$ is quasi-compact and separated, the terms of the bounded complex
$j_*\mathcal{F}^\bullet$ are quasi-coherent modules on $X$, see
Schemes, Lemma \ref{schemes-lemma-push-forward-quasi-coherent}.
We inductively pick a coherent submodule
$\mathcal{G}^i \subset j_*\mathcal{F}^i$ as follows.
For $i = a$ we pick any coherent submodule
$\mathcal{G}^a \subset j_*\mathcal{F}^a$ whose restriction
to $U$ is $\mathcal{F}^a$. This is possible by
Properties, Lemma \ref{properties-lemma-extend}.
For $i > a$ we first pick any coherent submodule
$\mathcal{H}^i \subset j_*\mathcal{F}^i$
whose restriction to $U$ is $\mathcal{F}^i$
and then we set
$\mathcal{G}^i = \Im(\mathcal{H}^i \oplus \mathcal{G}^{i - 1}
\to j_*\mathcal{F}^i)$. It is clear that
$\mathcal{G}^\bullet \subset j_*\mathcal{F}^\bullet$
is a bounded complex of coherent $\mathcal{O}_X$-modules
whose restriction to $U$ is $\mathcal{F}^\bullet$ as desired.
\end{proof}

\begin{lemma}
\label{lemma-lift-pseudo-coherent}
Let $X$ be an affine scheme and let $U \subset X$ be a quasi-compact
open subscheme. For any pseudo-coherent object $E$ of $D(\mathcal{O}_U)$
there exists a bounded above complex of finite free $\mathcal{O}_X$-modules 
whose restriction to $U$ is isomorphic to $E$.
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-pseudo-coherent} we see that $E$ is an object of
$D_\QCoh(\mathcal{O}_U)$. By
Lemma \ref{lemma-lift-quasi-coherent}
we may assume $E = E'|U$ for some object $E'$ of
$D_\QCoh(\mathcal{O}_X)$.
Write $X = \Spec(A)$. By Lemma \ref{lemma-affine-compare-bounded}
we can find a complex $M^\bullet$ of $A$-modules whose associated
complex of $\mathcal{O}_X$-modules is a representative of $E'$.

\medskip\noindent
Choose $f_1, \ldots, f_r \in A$ such that $U = D(f_1) \cup \ldots \cup D(f_r)$.
By Lemma \ref{lemma-pseudo-coherent-affine} the complexes
$M^\bullet_{f_j}$ are pseudo-coherent complexes of $A_{f_j}$-modules.
Let $n$ be an integer. Assume we have a map of complexes
$\alpha : F^\bullet \to M^\bullet$ where $F^\bullet$ is
bounded above, $F^i = 0$ for $i < n$, each $F^i$ is a finite free
$R$-module, such that
$$
H^i(\alpha_{f_j}) : H^i(F^\bullet_{f_j}) \to H^i(M^\bullet_{f_j})
$$
is an isomorphism for $i > n$ and surjective for $i = n$. Picture
$$
\xymatrix{
& F^n \ar[r] \ar[d]^\alpha & F^{n + 1} \ar[d]^\alpha \ar[r] & \ldots \\
M^{n-1} \ar[r] & M^n \ar[r] & M^{n + 1} \ar[r] & \ldots
}
$$
Since each $M^\bullet_{f_j}$ has vanishing cohomology
in large degrees we can find such a map for $n \gg 0$.
By induction on $n$ we are going to extend this to a map
of complexes $F^\bullet \to M^\bullet$
such that $H^i(\alpha_{f_j})$ is an isomorphism
for all $i$. The lemma will follow by taking $\widetilde{F^\bullet}$.

\medskip\noindent
The induction step will be to extend the diagram
above by adding $F^{n - 1}$. Let $C^\bullet$ be the cone on $\alpha$
(Derived Categories, Definition \ref{derived-definition-cone}).
The long exact sequence of cohomology shows that
$H^i(C^\bullet_{f_j}) = 0$ for $i \geq n$. By
More on Algebra, Lemma \ref{more-algebra-lemma-cone-pseudo-coherent}
we see that $C^\bullet_{f_j}$ is $(n - 1)$-pseudo-coherent. By
More on Algebra, Lemma \ref{more-algebra-lemma-finite-cohomology}
we see that $H^{n - 1}(C^\bullet_{f_j})$ is a finite $A_{f_j}$-module.
Choose a finite free $A$-module $F^{n - 1}$ and an $A$-module
$\beta : F^{n - 1} \to C^{n - 1}$ such that the composition
$F^{n - 1} \to C^{n - 1} \to C^n$ is zero and such that
$F^{n - 1}_{f_j}$ surjects onto $H^{n - 1}(C^\bullet_{f_j})$.
(Some details omitted; hint: clear denominators.)
Since $C^{n - 1} = M^{n - 1} \oplus F^n$
we can write $\beta = (\alpha^{n - 1}, -d^{n - 1})$. The vanishing of the
composition $F^{n - 1} \to C^{n - 1} \to C^n$ implies
these maps fit into a morphism of complexes
$$
\xymatrix{
& F^{n - 1} \ar[d]^{\alpha^{n - 1}} \ar[r]_{d^{n - 1}} &
F^n \ar[r] \ar[d]^\alpha &
F^{n + 1} \ar[d]^\alpha \ar[r] & \ldots \\
\ldots \ar[r] &
M^{n - 1} \ar[r] & M^n \ar[r] & M^{n + 1} \ar[r] & \ldots
}
$$
Moreover, these maps define a morphism of distinguished triangles
$$
\xymatrix{
(F^n \to \ldots) \ar[r] \ar[d] &
(F^{n-1} \to \ldots) \ar[r] \ar[d] &
F^{n-1} \ar[r] \ar[d]_\beta &
(F^n \to \ldots)[1] \ar[d] \\
(F^n \to \ldots) \ar[r] &
M^\bullet \ar[r] &
C^\bullet \ar[r] &
(F^n \to \ldots)[1]
}
$$
Hence our choice of $\beta$ implies that the map of complexes
$(F^{-1} \to \ldots) \to M^\bullet$ induces an isomorphism on
cohomology localized at $f_j$ in degrees $\geq n$ and a surjection
in degree $n - 1$. This finishes the proof of the lemma.
\end{proof}

\noindent
The following two lemmas should probably go somewhere else.

\begin{lemma}
\label{lemma-vanishing-ext}
Let $X$ be a quasi-compact and quasi-separated scheme.
Let $E \in D^b_\QCoh(\mathcal{O}_X)$.
There exists an integer $n_0 > 0$ such that
$\Ext^n_{D(\mathcal{O}_X)}(\mathcal{E}, E) = 0$
for every finite locally free
$\mathcal{O}_X$-module $\mathcal{E}$ and every $n \geq n_0$.
\end{lemma}

\begin{proof}
Recall that $\Ext^n_{D(\mathcal{O}_X)}(\mathcal{E}, E) =
\Hom_{D(\mathcal{O}_X)}(\mathcal{E}, E[n])$. We have
Mayer-Vietoris for morphisms in the derived category, see
Cohomology, Lemma \ref{cohomology-lemma-mayer-vietoris-hom}.
Thus if $X = U \cup V$ and the result of the lemma holds
for $E|_U$, $E|_V$, and $E|_{U \cap V}$ for some bound $n_0$,
then the result holds for $E$ with bound $n_0 + 1$.
Thus it suffices to prove the lemma when $X$ is affine, see
Cohomology of Schemes, Lemma \ref{coherent-lemma-induction-principle}.

\medskip\noindent
Assume $X = \Spec(A)$ is affine. Choose a complex of $A$-modules
$M^\bullet$ whose associated complex of quasi-coherent modules
represents $E$, see Lemma \ref{lemma-affine-compare-bounded}.
Write $\mathcal{E} = \widetilde{P}$ for some $A$-module $P$.
Since $\mathcal{E}$ is finite locally free, we see that $P$
is a finite projective $A$-module. We have
\begin{align*}
\Hom_{D(\mathcal{O}_X)}(\mathcal{E}, E[n])
& = 
\Hom_{D(A)}(P, M^\bullet[n]) \\
& =
\Hom_{K(A)}(P, M^\bullet[n]) \\
& =
\Hom_A(P, H^n(M^\bullet))
\end{align*}
The first equality by Lemma \ref{lemma-affine-compare-bounded},
the second equality by
Derived Categories, Lemma
\ref{derived-lemma-morphisms-from-projective-complex}, and
the final equality because $\Hom_A(P, -)$ is an exact functor.
As $E$ and hence $M^\bullet$ is bounded
we get zero for all sufficiently large $n$.
\end{proof}

\noindent
The following lemma can be strengthened (there is a uniformity
in the vanishing over all $L$ with nonzero cohomology sheaves
only in a fixed range).

\begin{lemma}
\label{lemma-ext-from-perfect-into-bounded-QCoh}
Let $X$ be a quasi-compact and quasi-separated scheme.
Let $K$ be a perfect object of $D(\mathcal{O}_X)$. Then
\begin{enumerate}
\item there exist integers $a \leq b$ such that for any
$L \in D_\QCoh(\mathcal{O}_X)$ with $H^i(L) = 0$ for $i \in [a, b]$
we have $\Hom_{D(\mathcal{O}_X)}(K, L) = 0$, and
\item if $L$ is bounded, then $\Ext^n_{D(\mathcal{O}_X)}(K, L)$
is zero for all but finitely many $n$.
\end{enumerate}
\end{lemma}

\begin{proof}
Part (2) follows from (1) as $\Ext^n_{D(\mathcal{O}_X)}(K, L) =
\Hom_{D(\mathcal{O}_X)}(K, L[n])$. We prove (1).
Since $K$ is perfect we have
$$
\Hom_{D(\mathcal{O}_X)}(K, L) =
H^0(X, K^\vee \otimes_{\mathcal{O}_X}^\mathbf{L} L)
$$
where $K^\vee$ is the ``dual'' perfect complex to $K$, see
Cohomology, Lemma \ref{cohomology-lemma-dual-perfect-complex}.
Note that $K^\vee \otimes_{\mathcal{O}_X}^\mathbf{L} L$
is in $D_\QCoh(X)$ by
Lemmas \ref{lemma-quasi-coherence-tensor-product} and
\ref{lemma-pseudo-coherent} (to see that a perfect complex
has quasi-coherent cohomology sheaves). Say $K^\vee$ has
tor amplitude in $[a, b]$. Then the spectral sequence
$$
E_1^{p, q} = H^p(K^\vee \otimes_{\mathcal{O}_X}^\mathbf{L} H^q(L))
\Rightarrow
H^{p + q}(K^\vee \otimes_{\mathcal{O}_X}^\mathbf{L} L)
$$
shows that $H^j(K^\vee \otimes_{\mathcal{O}_X}^\mathbf{L} L)$
is zero if $H^q(L) = 0$ for $q \in [j - b, j - a]$.
Let $N$ be the integer $d$ of Cohomology of Schemes,
Lemma \ref{coherent-lemma-vanishing-nr-affines-quasi-separated}.
Then $H^0(X, K^\vee \otimes_{\mathcal{O}_X}^\mathbf{L} L)$
vanishes if the cohomology sheaves
$$
H^{-N}(K^\vee \otimes_{\mathcal{O}_X}^\mathbf{L} L),
\ H^{-N + 1}(K^\vee \otimes_{\mathcal{O}_X}^\mathbf{L} L),
\ \ldots,
\ H^0(K^\vee \otimes_{\mathcal{O}_X}^\mathbf{L} L)
$$
are zero. Namely, by the lemma cited and
Lemma \ref{lemma-application-nice-K-injective}, we have
$$
H^0(X, K^\vee \otimes_{\mathcal{O}_X}^\mathbf{L} L) =
H^0(X, \tau_{\geq -N}(K^\vee \otimes_{\mathcal{O}_X}^\mathbf{L} L))
$$
and by the vanishing of cohomology sheaves, this is equal to
$H^0(X, \tau_{\geq 1}(K^\vee \otimes_{\mathcal{O}_X}^\mathbf{L} L))$
which is zero by Derived Categories, Lemma
\ref{derived-lemma-negative-vanishing}.
It follows that $\Hom_{D(\mathcal{O}_X)}(K, L)$ is zero if
$H^i(L) = 0$ for $i \in [-b - N, -a]$.
\end{proof}

\begin{lemma}
\label{lemma-lift-perfect-complex-plus-locally-free}
Let $X$ be an affine scheme. Let $U \subset X$ be a quasi-compact open.
For every perfect object $E$ of $D(\mathcal{O}_U)$ there exists an integer
$r$ and a finite locally free sheaf $\mathcal{F}$ on $U$ such that
$\mathcal{F}[-r] \oplus E$ is the restriction of a perfect object of
$D(\mathcal{O}_X)$.
\end{lemma}

\begin{proof}
Say $X = \Spec(A)$. Recall that a perfect complex is
pseudo-coherent, see
Cohomology, Lemma \ref{cohomology-lemma-perfect}.
By Lemma \ref{lemma-lift-pseudo-coherent} we can find a bounded above complex
$\mathcal{F}^\bullet$ of finite free $A$-modules such that $E$ is
isomorphic to $\mathcal{F}^\bullet|_U$ in $D(\mathcal{O}_U)$.
By Cohomology, Lemma \ref{cohomology-lemma-perfect} and since
$U$ is quasi-compact, we see that $E$ has finite tor dimension, say
$E$ has tor amplitude in $[a, b]$. Pick $r < a$ and set
$$
\mathcal{K} = \Ker(\mathcal{F}^{r} \to \mathcal{F}^{r + 1})
= \Im(\mathcal{F}^{r - 1} \to \mathcal{F}^r).
$$
Since $E$ has tor amplitude in $[a, b]$ we see that
$\mathcal{F} = \mathcal{K}|_U$ is
flat (Cohomology, Lemma \ref{cohomology-lemma-last-one-flat}).
Hence $\mathcal{F}$ is flat and of finite presentation, thus finite
locally free (Properties, Lemma \ref{properties-lemma-finite-locally-free}).
It follows that
$$
\mathcal{F} \to \mathcal{F}^r|_U \to \mathcal{F}^{r + 1}|_U \to \ldots
$$
is a strictly perfect complex on $U$ representing $E$. On the other hand,
the complex $P = (\mathcal{F}^r \to \mathcal{F}^{r + 1} \to \ldots )$
is a perfect complex on $X$. Using
stupid truncations we obtain a distinguished triangle
$$
P|_U \to E \to \mathcal{F}[-r - 1] \to (P|_U)[1]
$$
If the map $E \to \mathcal{F}[-r - 1]$ is zero in $D(\mathcal{O}_U)$,
then $P|_U = \mathcal{F}[-r - 2] \oplus E$, see
Derived Categories, Lemma \ref{derived-lemma-split}.
This will be true for $r \ll 0$ for example by
Lemma \ref{lemma-ext-from-perfect-into-bounded-QCoh}.
\end{proof}

\begin{lemma}
\label{lemma-lift-map}
Let $X$ be an affine scheme. Let $U \subset X$ be a quasi-compact open.
Let $E, E'$ be objects of $D_\QCoh(\mathcal{O}_X)$ with $E$ perfect.
For every map $\alpha : E|_U \to E'|_U$ there exist maps
$$
E \xleftarrow{\beta} E_1 \xrightarrow{\gamma} E'
$$
of complexes on $X$ with $E_1$ perfect such that $\beta : E_1 \to E$
restricts to an isomorphism on $U$ and such that
$\alpha = \gamma|_U \circ \beta|_U^{-1}$.
Moreover we can assume $E_1 = E \otimes_{\mathcal{O}_X}^\mathbf{L} I$
for some perfect complex $I$ on $X$.
\end{lemma}

\begin{proof}
Write $X = \Spec(A)$. Write $U = D(f_1) \cup \ldots \cup D(f_r)$. Choose
finite complex of finite projective $A$-modules $M^\bullet$ representing
$E$ (Lemma \ref{lemma-perfect-affine}). Choose a complex of $A$-modules
$(M')^\bullet$ representing $E'$ (Lemma \ref{lemma-affine-compare-bounded}).
In this case the complex $H^\bullet = \Hom_A(M^\bullet, (M')^\bullet)$
is a complex of $A$-modules whose associated complex of quasi-coherent
$\mathcal{O}_X$-modules represents $R\SheafHom(E, E')$, see
Cohomology, Lemma \ref{cohomology-lemma-Rhom-strictly-perfect}.
Then $\alpha$ determines an element $s$ of $H^0(U, R\SheafHom(E, E'))$, see
Cohomology, Lemma \ref{cohomology-lemma-section-RHom-over-U}.
There exists an $e$ and a map
$$
\xi : I^\bullet(f_1^e, \ldots, f_r^e) \to \Hom_A(M^\bullet, (M')^\bullet)
$$
corresponding to $s$, see
Proposition \ref{proposition-represent-cohomology-class-on-open}.
Letting $E_1$ be the object corresponding to
complex of quasi-coherent $\mathcal{O}_X$-modules
associated to
$$
\text{Tot}(I^\bullet(f_1^e, \ldots, f_r^e) \otimes_A M^\bullet)
$$
we obtain $E_1 \to E$ using the canonical map
$I^\bullet(f_1^e, \ldots, f_r^e) \to A$ and $E_1 \to E'$
using $\xi$ and
Cohomology, Lemma \ref{cohomology-lemma-section-RHom-over-U}.
\end{proof}

\begin{lemma}
\label{lemma-lift-perfect-complex-plus-shift}
Let $X$ be an affine scheme. Let $U \subset X$ be a quasi-compact open.
For every perfect object $F$ of $D(\mathcal{O}_U)$
the object $F \oplus F[1]$ is the restriction of
a perfect object of $D(\mathcal{O}_X)$.
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-lift-perfect-complex-plus-locally-free}
we can find a perfect object $E$ of $D(\mathcal{O}_X)$
such that $E|_U = \mathcal{F}[r] \oplus F$ for some finite locally
free $\mathcal{O}_U$-module $\mathcal{F}$.
By Lemma \ref{lemma-lift-map} we can find a morphism of
perfect complexes $\alpha : E_1 \to E$ such that $(E_1)|_U \cong E|_U$
and such that $\alpha|_U$ is the map
$$
\left(
\begin{matrix}
\text{id}_{\mathcal{F}[r]} & 0 \\
0 & 0
\end{matrix}
\right)
:
\mathcal{F}[r] \oplus F \to \mathcal{F}[r] \oplus F
$$
Then the cone on $\alpha$ is a solution.
\end{proof}

\begin{lemma}
\label{lemma-perfect-into-support-on-T}
Let $X$ be a quasi-compact and quasi-separated scheme.
Let $f \in \Gamma(X, \mathcal{O}_X)$.
For any morphism $\alpha : E \to E'$ in
$D_\QCoh(\mathcal{O}_X)$ such that
\begin{enumerate}
\item $E$ is perfect, and
\item $E'$ is supported on $T = V(f)$
\end{enumerate}
there exists an $n \geq 0$ such that $f^n \alpha  = 0$.
\end{lemma}

\begin{proof}
We have Mayer-Vietoris for morphisms in the derived category, see
Cohomology, Lemma \ref{cohomology-lemma-mayer-vietoris-hom}.
Thus if $X = U \cup V$ and the result of the lemma holds
for $f|_U$, $f|_V$, and $f|_{U \cap V}$, then the result holds for $f$.
Thus it suffices to prove the lemma when $X$ is affine, see
Cohomology of Schemes, Lemma \ref{coherent-lemma-induction-principle}.

\medskip\noindent
Let $X = \Spec(A)$. Then $f \in A$. We will
use the equivalence $D(A) = D_\QCoh(X)$ of
Lemma \ref{lemma-affine-compare-bounded}
without further mention.
Represent $E$ by a finite complex of finite projective $A$-modules
$P^\bullet$. This is possible by Lemma \ref{lemma-perfect-affine}.
Let $t$ be the largest integer such that $P^t$ is nonzero.
The distinguished triangle
$$
P^t[-t] \to P^\bullet \to \sigma_{\leq t - 1}P^\bullet \to P^t[-t + 1]
$$
shows that by induction on the length of the complex $P^\bullet$
we can reduce to the case where $P^\bullet$ has a single nonzero term.
This and the shift functor reduces us to the case where $P^\bullet$
consists of a single finite projective $A$-module $P$ in degree $0$.
Represent $E'$ by a complex $M^\bullet$ of $A$-modules.
Then $\alpha$ corresponds to a map $P \to H^0(M^\bullet)$.
Since the module $H^0(M^\bullet)$ is supported on $V(f)$ by assumption (2)
we see that every element of $H^0(M^\bullet)$ is annihilated by a power
of $f$. Since $P$ is a finite $A$-module the map
$f^n\alpha : P \to H^0(M^\bullet)$ is zero for some $n$ as desired.
\end{proof}

\begin{lemma}
\label{lemma-lift-perfect-complex-plus-shift-support}
Let $X$ be an affine scheme. Let $T \subset X$ be a closed subset
such that $X \setminus T$ is quasi-compact. Let $U \subset X$ be a
quasi-compact open. For every perfect object $F$ of $D(\mathcal{O}_U)$
supported on $T \cap U$ the object $F \oplus F[1]$ is the restriction of
a perfect object $E$ of $D(\mathcal{O}_X)$ supported in $T$.
\end{lemma}

\begin{proof}
Say $T = V(g_1, \ldots, g_s)$. After replacing $g_j$ by a power we
may assume multiplication by $g_j$ is zero on $F$, see
Lemma \ref{lemma-perfect-into-support-on-T}. Choose $E$ as in
Lemma \ref{lemma-lift-perfect-complex-plus-shift}.
Note that $g_j : E \to E$ restricts to zero on $U$.
Choose a distinguished triangle
$$
E \xrightarrow{g_1} E \to C_1 \to E[1]
$$
By Derived Categories, Lemma \ref{derived-lemma-split}
the object $C_1$ restricts to
$F \oplus F[1] \oplus F[1] \oplus F[2]$ on $U$.
Moreover, $g_1 : C_1 \to C_1$ has square zero by
Derived Categories, Lemma \ref{derived-lemma-third-map-square-zero}.
Namely, the diagram
$$
\xymatrix{
E \ar[r] \ar[d]_0 & C_1 \ar[d]_{g_1} \ar[r] & E[1] \ar[d]_0 \\
E \ar[r] & C_1 \ar[r] & E[1]
}
$$
is commutative since the compositions $E \xrightarrow{g_1} E \to C_1$ and
$C_1 \to E[1] \xrightarrow{g_1} E[1]$ are zero. Continuing, setting
$C_{i + 1}$ equal to the cone of the map $g_i : C_i \to C_i$ we obtain
a perfect complex $C_s$ on $X$ supported on $T$
whose restriction to $U$ gives
$$
F \oplus F[1]^{\oplus s} \oplus F[2]^{\oplus {s \choose 2}}
\oplus \ldots \oplus F[s]
$$
Choose morphisms of perfect complexes $\beta : C' \to C_s$
and $\gamma : C' \to C_s$ as in Lemma \ref{lemma-lift-map}
such that $\beta|_U$ is an isomorphism and such that
$\gamma|_U \circ \beta|_U^{-1}$ is the morphism
$$
F \oplus F[1]^{\oplus s} \oplus F[2]^{\oplus {s \choose 2}}
\oplus \ldots \oplus F[s]
\to
F \oplus F[1]^{\oplus s} \oplus F[2]^{\oplus {s \choose 2}}
\oplus \ldots \oplus F[s]
$$
which is the identity on all summands except for $F$ where it is zero.
By Lemma \ref{lemma-lift-map} we also have
$C' = C_s \otimes^\mathbf{L} I$ for some perfect complex
$I$ on $X$. Hence the nullity of $g_j^2\text{id}_{C_s}$ implies the
same thing for $C'$. Thus $C'$ is supported on $T$ as well.
Then $\text{Cone}(\gamma)$ is a solution.
\end{proof}

\noindent
A special case of the following lemma can be found in
\cite{Neeman-Grothendieck}.

\begin{lemma}
\label{lemma-lift-map-from-perfect-complex-with-support}
Let $X$ be a quasi-compact and quasi-separated scheme.
Let $U \subset X$ be a quasi-compact open. Let $T \subset X$
be a closed subset with $X \setminus T$ retro-compact in $X$.
Let $E$ be an object of $D_\QCoh(\mathcal{O}_X)$.
Let $\alpha : P \to E|_U$ be a map where $P$ is a perfect object of
$D(\mathcal{O}_U)$ supported on $T \cap U$. Then there exists a map
$\beta : R \to E$ where $R$ is a perfect object of $D(\mathcal{O}_X)$
supported on $T$ such that $P$ is a direct summand of $R|_U$ in
$D(\mathcal{O}_U)$ compatible $\alpha$ and $\beta|_U$.
\end{lemma}

\begin{proof}
Since $X$ is quasi-compact there exists an integer $m$ such that
$X = U \cup V_1 \cup \ldots \cup V_m$ for some affine opens $V_j$ of $X$.
Arguing by induction on $m$ we see that we may assume $m = 1$. In other
words, we may assume that $X = U \cup V$ with $V$ affine. By
Lemma \ref{lemma-lift-perfect-complex-plus-shift-support}
we can choose a perfect object $Q$ in $D(\mathcal{O}_V)$
supported on $T \cap V$ and an isomorphism
$Q|_{U \cap V} \to (P \oplus P[1])|_{U \cap V}$.
By Lemma \ref{lemma-lift-map} we can replace $Q$ by
$Q \otimes^\mathbf{L} I$ (still supported on $T \cap V$)
and assume that the map
$$
Q|_{U \cap V} \to (P \oplus P[1])|_{U \cap V}
\longrightarrow P|_{U \cap V}
\longrightarrow
E|_{U \cap V}
$$
lifts to $Q \to E|_V$. By
Cohomology, Lemma \ref{cohomology-lemma-glue}
we find an morphism $a : R \to E$ of $D(\mathcal{O}_X)$
such that $a|_U$ is isomorphic to $P \oplus P[1] \to E|_U$
and $a|_V$ isomorphic to $Q \to E|_V$.
Thus $R$ is perfect and supported on $T$ as desired.
\end{proof}

\begin{remark}
\label{remark-addendum}
The proof of Lemma \ref{lemma-lift-map-from-perfect-complex-with-support}
shows that
$$
R|_U = P \oplus P^{\oplus n_1}[1] \oplus \ldots \oplus P^{\oplus n_m}[m]
$$
for some $m \geq 0$ and $n_j \geq 0$. Thus the highest degree cohomology sheaf
of $R|_U$ equals that of $P$. By repeating the construction for the map
$P^{\oplus n_1}[1] \oplus \ldots \oplus P^{\oplus n_m}[m] \to R|_U$, taking
cones, and using induction we can achieve equality of cohomology sheaves
of $R|_U$ and $P$ above any given degree.
\end{remark}



\section{Approximation by perfect complexes}
\label{section-approximation}

\noindent
In this section we discuss the observation, due to Neeman and Lipman,
that a pseudo-coherent complex can be ``approximated'' by perfect complexes.

\begin{definition}
\label{definition-approximation-holds}
Let $X$ be a scheme. Consider triples $(T, E, m)$ where
\begin{enumerate}
\item $T \subset X$ is a closed subset,
\item $E$ is an object of $D_\QCoh(\mathcal{O}_X)$, and
\item $m \in \mathbf{Z}$.
\end{enumerate}
We say {\it approximation holds for the triple} $(T, E, m)$ if
there exists a perfect object $P$ of $D(\mathcal{O}_X)$ supported on $T$
and a map $\alpha : P \to E$ which induces isomorphisms $H^i(P) \to H^i(E)$
for $i > m$ and a surjection $H^m(P) \to H^m(E)$.
\end{definition}

\noindent
Approximation cannot hold for every triple. Namely, it is clear that if
approximation holds for the triple $(T, E, m)$, then
\begin{enumerate}
\item $E$ is $m$-pseudo-coherent, see
Cohomology, Definition \ref{cohomology-definition-pseudo-coherent}, and
\item the cohomology sheaves $H^i(E)$ are supported on $T$ for $i \geq m$.
\end{enumerate}
Moreover, the ``support'' of a perfect complex is a closed subscheme
whose complement is retrocompact in $X$ (details omitted). Hence we cannot
expect approximation to hold without this assumption on $T$.
This partly explains the conditions in the following definition.

\begin{definition}
\label{definition-approximation}
Let $X$ be a scheme. We say {\it approximation by perfect complexes holds}
on $X$ if for any closed subset $T \subset X$ with $X \setminus T$
retro-compact in $X$ there exists an integer $r$ such that
for every triple $(T, E, m)$ as in
Definition \ref{definition-approximation-holds} with
\begin{enumerate}
\item $E$ is $(m - r)$-pseudo-coherent, and
\item $H^i(E)$ is supported on $T$ for $i \geq m - r$
\end{enumerate}
approximation holds.
\end{definition}

\noindent
We will prove that approximation by perfect complexes holds for
quasi-compact and quasi-separated schemes. It seems that the second
condition is necessary for our method of proof. It is possible that the
first condition may be weakened to ``$E$ is $m$-pseudo-coherent''
by carefully analyzing the arguments below.

\begin{lemma}
\label{lemma-open}
Let $X$ be a scheme. Let $U \subset X$ be an open subscheme.
Let $(T, E, m)$ be a triple as in
Definition \ref{definition-approximation-holds}.
If
\begin{enumerate}
\item $T \subset U$,
\item approximation holds for $(T, E|_U, m)$, and
\item the sheaves $H^i(E)$ for $i \geq m$ are supported on $T$,
\end{enumerate}
then approximation holds for $(T, E, m)$.
\end{lemma}

\begin{proof}
Let $j : U \to X$ be the inclusion morphism.
If $P \to E|_U$ is an approximation of the triple $(T, E|_U, m)$
over $U$, then $j_!P = Rj_*P \to j_!(E|_U) \to E$ is an approximation
of $(T, E, m)$ over $X$.
See Cohomology, Lemmas \ref{cohomology-lemma-pushforward-restriction} and
\ref{cohomology-lemma-pushforward-perfect}.
\end{proof}

\begin{lemma}
\label{lemma-approximation-affine}
Let $X$ be an affine scheme. Then approximation holds for every
triple $(T, E, m)$ as in Definition \ref{definition-approximation-holds}
such that there exists an integer $r \geq 0$ with
\begin{enumerate}
\item $E$ is $m$-pseudo-coherent,
\item $H^i(E)$ is supported on $T$ for $i \geq m - r + 1$,
\item $X \setminus T$ is the union of $r$ affine opens.
\end{enumerate}
In particular, approximation by perfect complexes holds for affine schemes.
\end{lemma}

\begin{proof}
Say $X = \Spec(A)$. Write $T = V(f_1, \ldots, f_r)$.
(The case $r = 0$, i.e., $T = X$ follows immediately from
Lemma \ref{lemma-pseudo-coherent-affine} and the definitions.)
Let $(T, E, m)$ be a triple as in the lemma.
Let $t$ be the largest integer such that $H^t(E)$ is nonzero.
We will proceed by induction on $t$. The base case is $t < m$; in
this case the result is trivial. Now suppose that $t \geq m$. By
Cohomology, Lemma \ref{cohomology-lemma-finite-cohomology}
the sheaf $H^t(E)$ is of finite type. Since it is quasi-coherent
it is generated by finitely many sections
(Properties, Lemma \ref{properties-lemma-finite-type-module}).
For every $s \in \Gamma(X, H^t(E)) = H^t(X, E)$
(see proof of Lemma \ref{lemma-affine-compare-bounded})
we can find an $e > 0$ and a morphism $K_e[-t] \to E$
such that $s$ is in the image of
$H^0(K_e) = H^t(K_e[-t]) \to H^t(E)$, see
Lemma \ref{lemma-represent-cohomology-class-on-closed}.
Taking a finite direct sum of these maps we obtain a map
$P \to E$ where $P$ is a perfect complex supported on $T$,
where $H^i(P) = 0$ for $i > t$, and where $H^t(P) \to E$ is
surjective. Choose a distinguished triangle
$$
P \to E \to E' \to P[1]
$$
Then $E'$ is $m$-pseudo-coherent
(Cohomology, Lemma \ref{cohomology-lemma-cone-pseudo-coherent}),
$H^i(E') = 0$ for $i \geq t$, and
$H^i(E')$ is supported on $T$ for $i \geq m - r + 1$.
By induction we find an approximation $P' \to E'$
of $(T, E', m)$. Fit the composition $P' \to E' \to P[1]$
into a distinguished triangle $P \to P'' \to P' \to P[1]$
and extend the morphisms $P' \to E'$ and $P[1] \to P[1]$ into
a morphism of distinguished triangles
$$
\xymatrix{
P \ar[r] \ar[d] & P'' \ar[d] \ar[r] & P' \ar[d] \ar[r] & P[1] \ar[d] \\
P \ar[r] &  E \ar[r] & E' \ar[r] & P[1]
}
$$
using TR3. Then $P''$ is a perfect complex
(Cohomology, Lemma \ref{cohomology-lemma-two-out-of-three-perfect})
supported on $T$.
An easy diagram chase shows that $P'' \to E$ is the desired
approximation.
\end{proof}

\begin{lemma}
\label{lemma-induction-step}
Let $X$ be a scheme. Let $X = U \cup V$ be an open covering
with $U$ quasi-compact, $V$ affine, and $U \cap V$ quasi-compact.
If approximation by perfect complexes holds on $U$,
then approximation holds on $X$.
\end{lemma}

\begin{proof}
Let $T \subset X$ be a closed subset with $X \setminus T$ retro-compact
in $X$. Let $r_U$ be the integer of Definition \ref{definition-approximation}
adapted to the pair $(U, T \cap U)$.
Set $T' = T \setminus U$. Note that
$T' \subset V$ and that $V \setminus T' = (X \setminus T) \cap U \cap V$
is quasi-compact by our assumption on $T$.
Let $r'$ be the number of affines needed to cover $V \setminus T'$.
We claim that $r = \max(r_U, r')$ works for the pair $(X, T)$.

\medskip\noindent
To see this choose a triple $(T, E, m)$ such that $E$ is
$(m - r)$-pseudo-coherent and $H^i(E)$ is supported on $T$ for
$i \geq m - r$. Let $t$ be the largest integer such that
$H^t(E)|_U$ is nonzero. (Such an integer exists as $U$ is quasi-compact
and $E|_U$ is $(m - r)$-pseudo-coherent.)
We will prove that $E$ can be approximated by induction on $t$.

\medskip\noindent
Base case: $t \leq m - r'$. This means that $H^i(E)$ is supported
on $T'$ for $i \geq m - r'$. Hence
Lemma \ref{lemma-approximation-affine}
guarantees the existence of an approximation
$P \to E|_V$ of $(T', E|_V, m)$ on $V$.
Applying Lemma \ref{lemma-open} we see that
$(T', E, m)$ can be approximated. Such an approximation
is also an approximation of $(T, E, m)$.

\medskip\noindent
Induction step. Choose an approximation $P \to E|_U$
of $(T \cap U, E|_U, m)$. This in particular gives a surjection
$H^t(P) \to H^t(E|_U)$. By
Lemma \ref{lemma-lift-perfect-complex-plus-shift-support}
we can choose a perfect object $Q$ in $D(\mathcal{O}_V)$
supported on $T \cap V$ and an isomorphism
$Q|_{U \cap V} \to (P \oplus P[1])|_{U \cap V}$.
By Lemma \ref{lemma-lift-map} we can replace $Q$ by
$Q \otimes^\mathbf{L} I$
and assume that the map
$$
Q|_{U \cap V} \to (P \oplus P[1])|_{U \cap V}
\longrightarrow P|_{U \cap V}
\longrightarrow
E|_{U \cap V}
$$
lifts to $Q \to E|_V$. By
Cohomology, Lemma \ref{cohomology-lemma-glue}
we find an morphism $a : R \to E$ of $D(\mathcal{O}_X)$
such that $a|_U$ is isomorphic to $P \oplus P[1] \to E|_U$
and $a|_V$ isomorphic to $Q \to E|_V$.
Thus $R$ is perfect and supported on $T$
and the map $H^t(R) \to H^t(E)$ is surjective on restriction to $U$.
Choose a distinguished triangle
$$
R \to E \to E' \to R[1]
$$
Then $E'$ is $(m - r)$-pseudo-coherent
(Cohomology, Lemma \ref{cohomology-lemma-cone-pseudo-coherent}),
$H^i(E')|_U = 0$ for $i \geq t$, and
$H^i(E')$ is supported on $T$ for $i \geq m - r$.
By induction we find an approximation $R' \to E'$
of $(T, E', m)$. Fit the composition $R' \to E' \to R[1]$
into a distinguished triangle $R \to R'' \to R' \to R[1]$
and extend the morphisms $R' \to E'$ and $R[1] \to R[1]$ into
a morphism of distinguished triangles
$$
\xymatrix{
R \ar[r] \ar[d] & R'' \ar[d] \ar[r] & R' \ar[d] \ar[r] & R[1] \ar[d] \\
R \ar[r] &  E \ar[r] & E' \ar[r] & R[1]
}
$$
using TR3. Then $R''$ is a perfect complex
(Cohomology, Lemma \ref{cohomology-lemma-two-out-of-three-perfect})
supported on $T$.
An easy diagram chase shows that $R'' \to E$ is the desired
approximation.
\end{proof}

\begin{theorem}
\label{theorem-approximation}
Let $X$ be a quasi-compact and quasi-separated scheme.
Then approximation by perfect complexes holds on $X$.
\end{theorem}

\begin{proof}
This follows from the induction principle of
Cohomology of Schemes, Lemma \ref{coherent-lemma-induction-principle}
and Lemmas \ref{lemma-induction-step} and \ref{lemma-approximation-affine}.
\end{proof}






\section{Generating derived categories}
\label{section-generating}

\noindent
In this section we prove that the derived category
$D_\QCoh(\mathcal{O}_X)$ of a quasi-compact
and quasi-separated scheme can be generated by a single perfect object.
We urge the reader to read the proof of this result in the wonderful paper by
Bondal and van den Bergh, see \cite{BvdB}.

\begin{lemma}
\label{lemma-direct-summand-of-a-restriction}
Let $X$ be a quasi-compact and quasi-separated scheme.
Let $U$ be a quasi-compact open subscheme.
Let $P$ be a perfect object of $D(\mathcal{O}_U)$.
Then $P$ is a direct summand of the restriction of a perfect
object of $D(\mathcal{O}_X)$.
\end{lemma}

\begin{proof}
Special case of Lemma \ref{lemma-lift-map-from-perfect-complex-with-support}.
\end{proof}

\begin{lemma}
\label{lemma-orthogonal-koszul-complex}
\begin{reference}
\cite[Proposition 6.1]{Bokstedt-Neeman}
\end{reference}
In Situation \ref{situation-complex} denote $j : U \to X$ the open
immersion and let $K$ be the perfect object of $D(\mathcal{O}_X)$
corresponding to the Koszul complex on $f_1, \ldots, f_r$ over $A$.
For $E \in D_\QCoh(\mathcal{O}_X)$ the following are equivalent
\begin{enumerate}
\item $E = Rj_*(E|_U)$, and
\item $\Hom_{D(\mathcal{O}_X)}(K[n], E) = 0$ for all $n \in \mathbf{Z}$.
\end{enumerate}
\end{lemma}

\begin{proof}
Choose a distinguished triangle $E \to Rj_*(E|_U) \to N \to E[1]$.
Observe that
$$
\Hom_{D(\mathcal{O}_X)}(K[n], Rj_*(E|_U)) =
\Hom_{D(\mathcal{O}_U)}(K|_U[n], E) = 0
$$
for all $n$ as $K|_U = 0$. Thus it suffices to prove the result for
$N$. In other words, we may assume that $E$ restricts to zero on $U$.
Observe that there are distinguished triangles
$$
K^\bullet(f_1^{e_1}, \ldots, f_i^{e'_i}, \ldots, f_r^{e_r}) \to
K^\bullet(f_1^{e_1}, \ldots, f_i^{e'_i + e''_i}, \ldots, f_r^{e_r}) \to
K^\bullet(f_1^{e_1}, \ldots, f_i^{e''_i}, \ldots, f_r^{e_r}) \to \ldots
$$
of Koszul complexes, see
More on Algebra, Lemma \ref{more-algebra-lemma-koszul-mult}.
Hence if $\Hom_{D(\mathcal{O}_X)}(K[n], E) = 0$ for all $n \in \mathbf{Z}$
then the same thing is true for the $K$ replaced by
$K_e$ as in Lemma \ref{lemma-represent-cohomology-class-on-closed}.
Thus our lemma follows immediately from that one and the fact that $E$
is determined by the complex of $A$-modules $R\Gamma(X, E)$, see
Lemma \ref{lemma-affine-compare-bounded}.
\end{proof}

\begin{theorem}
\label{theorem-bondal-van-den-Bergh}
Let $X$ be a quasi-compact and quasi-separated scheme. The category
$D_\QCoh(\mathcal{O}_X)$ can be generated by a single
perfect object. More precisely, there exists a perfect object
$P$ of $D(\mathcal{O}_X)$ such that for 
$E \in D_\QCoh(\mathcal{O}_X)$ the following are equivalent
\begin{enumerate}
\item $E = 0$, and
\item $\Hom_{D(\mathcal{O}_X)}(P[n], E) = 0$ for all $n \in \mathbf{Z}$.
\end{enumerate}
\end{theorem}

\begin{proof}
We will prove this using the induction principle of
Cohomology of Schemes, Lemma \ref{coherent-lemma-induction-principle}.

\medskip\noindent
If $X$ is affine, then $\mathcal{O}_X$ is a perfect generator.
This follows from Lemma \ref{lemma-affine-compare-bounded}.

\medskip\noindent
Assume that $X = U \cup V$ is an open covering with $U$ quasi-compact
such that the theorem holds for $U$ and $V$ is an affine open.
Let $P$ be a perfect object of $D(\mathcal{O}_U)$ which is a generator
for $D_\QCoh(\mathcal{O}_U)$. Using
Lemma \ref{lemma-direct-summand-of-a-restriction} we may
choose a perfect object
$Q$ of $D(\mathcal{O}_X)$ whose restriction to $U$ is a direct sum one
of whose summands is $P$. Say $V = \Spec(A)$. Let $Z = X \setminus U$.
This is a closed subset of $V$ with $V \setminus Z$ quasi-compact.
Choose $f_1, \ldots, f_r \in A$ such that
$Z = V(f_1, \ldots, f_r)$. Let $K \in D(\mathcal{O}_V)$ be the perfect
object corresponding to the Koszul complex on $f_1, \ldots, f_r$ over $A$.
Note that since $K$ is supported on $Z \subset V$ closed, the pushforward
$K' = R(V \to X)_*K$ is a perfect object of $D(\mathcal{O}_X)$ whose
restriction to $V$ is $K$ (see
Cohomology, Lemma \ref{cohomology-lemma-pushforward-perfect}).
We claim that $Q \oplus K'$ is a generator for
$D_\QCoh(\mathcal{O}_X)$.

\medskip\noindent
Let $E$ be an object of $D_\QCoh(\mathcal{O}_X)$ such that
there are no nontrivial maps from any shift of $Q \oplus K'$ into $E$.
By Cohomology, Lemma \ref{cohomology-lemma-pushforward-restriction}
we have $K' =  R(V \to X)_! K$ and hence
$$
\Hom_{D(\mathcal{O}_X)}(K'[n], E) = \Hom_{D(\mathcal{O}_V)}(K[n], E|_V)
$$
Thus by Lemma \ref{lemma-orthogonal-koszul-complex} the vanishing of
these groups implies that $E|_V$ is isomorphic to
$R(U \cap V \to V)_*E|_{U \cap V}$. This implies that $E = R(U \to X)_*E|_U$
(small detail omitted). If this is the case then
$$
\Hom_{D(\mathcal{O}_X)}(Q[n], E) = \Hom_{D(\mathcal{O}_U)}(Q|_U[n], E|_U)
$$
which contains $\Hom_{D(\mathcal{O}_U)}(P[n], E|_U)$ as a direct summand.
Thus by our choice of $P$ the vanishing of these groups implies that $E|_U$
is zero. Whence $E$ is zero.
\end{proof}

\noindent
The following result is an strengthening of
Theorem \ref{theorem-bondal-van-den-Bergh}
proved using exactly the same methods.
Recall that for a closed subset $T$ of a scheme $X$ we denote
$D_T(\mathcal{O}_X)$ the strictly full, saturated,
triangulated subcategory of $D(\mathcal{O}_X)$ consisting of objects
supported on $T$ (Definition \ref{definition-supported-on}).
We similarly denote $D_{\QCoh, T}(\mathcal{O}_X)$ the strictly full, saturated,
triangulated subcategory of $D(\mathcal{O}_X)$ consisting of those
complexes whose cohomology sheaves are quasi-coherent and are supported
on $T$.

\begin{lemma}
\label{lemma-generator-with-support}
\begin{reference}
\cite[Theorem 6.8]{Rouquier-dimensions}
\end{reference}
Let $X$ be a quasi-compact and quasi-separated scheme. Let $T \subset X$ be a
closed subset such that $X \setminus T$ is quasi-compact. With notation
as above, the category $D_{\QCoh, T}(\mathcal{O}_X)$ is generated by a
single perfect object.
\end{lemma}

\begin{proof}
We will prove this using the induction principle of
Cohomology of Schemes, Lemma \ref{coherent-lemma-induction-principle}.

\medskip\noindent
Assume $X = \Spec(A)$ is affine. In this case there exist
$f_1, \ldots, f_r \in A$ such that $T = V(f_1, \ldots, f_r)$.
Let $K$ be the Koszul complex on $f_1, \ldots, f_r$ as in
Lemma \ref{lemma-orthogonal-koszul-complex}.
Then $K$ is a perfect object with cohomology supported on
$T$ and hence a perfect object of $D_{\QCoh, T}(\mathcal{O}_X)$.
On the other hand, if $E \in D_{\QCoh, T}(\mathcal{O}_X)$ and
$\Hom(K, E[n]) = 0$ for all $n$, then
Lemma \ref{lemma-orthogonal-koszul-complex}
tells us that $E = Rj_*(E|_{X \setminus T}) = 0$.
Hence $K$ generates $D_{\QCoh, T}(\mathcal{O}_X)$,
(by our definition of generators of triangulated categories in
Derived Categories, Definition \ref{derived-definition-generators}).

\medskip\noindent
Assume that $X = U \cup V$ is an open covering with $V$ affine and
$U$ quasi-compact such that the lemma holds for $U$.
Let $P$ be a perfect object of $D(\mathcal{O}_U)$ supported on $T \cap U$
which is a generator for $D_{\QCoh, T \cap U}(\mathcal{O}_U)$. Using
Lemma \ref{lemma-lift-map-from-perfect-complex-with-support}
we may choose a perfect object $Q$ of $D(\mathcal{O}_X)$ supported on $T$
whose restriction to $U$ is a direct sum one of whose summands is $P$.
Write $V = \Spec(B)$. Let $Z = X \setminus U$. Then $Z$ is a closed subset
of $V$ such that $V \setminus Z$ is quasi-compact. As $X$ is quasi-separated,
it follows that $Z \cap T$ is a closed subset of $V$ such that
$W = V \setminus (Z \cap T)$ is quasi-compact. Thus we can choose
$g_1, \ldots, g_s \in B$ such that $Z \cap T = V(g_1, \ldots, g_r)$.
Let $K \in D(\mathcal{O}_V)$ be the perfect object corresponding to the
Koszul complex on $g_1, \ldots, g_s$ over $B$. Note that since $K$ is
supported on $(Z \cap T) \subset V$ closed, the pushforward
$K' = R(V \to X)_*K$ is a perfect object of $D(\mathcal{O}_X)$ whose
restriction to $V$ is $K$ (see
Cohomology, Lemma \ref{cohomology-lemma-pushforward-perfect}).
We claim that $Q \oplus K'$ is a generator for
$D_{\QCoh, T}(\mathcal{O}_X)$.

\medskip\noindent
Let $E$ be an object of $D_{\QCoh, T}(\mathcal{O}_X)$ such that
there are no nontrivial maps from any shift of $Q \oplus K'$ into $E$.
By Cohomology, Lemma \ref{cohomology-lemma-pushforward-restriction}
we have $K' =  R(V \to X)_! K$ and hence
$$
\Hom_{D(\mathcal{O}_X)}(K'[n], E) = \Hom_{D(\mathcal{O}_V)}(K[n], E|_V)
$$
Thus by Lemma \ref{lemma-orthogonal-koszul-complex} we have
$E|_V = Rj_*E|_W$ where $j : W \to V$ is the inclusion. Picture
$$
\xymatrix{
W \ar[r]_j & V & Z \cap T \ar[l] \ar[d] \\
U \cap V \ar[u]^{j'} \ar[ru]_{j''} & & Z \ar[lu]
}
$$
Since $E$ is supported on $T$ we see that $E|_W$ is supported on
$T \cap W = T \cap U \cap V$ which is closed in $W$.
We conclude that
$$
E|_V = Rj_*(E|_W) = Rj_*(Rj'_*(E|_{U \cap V})) = Rj''_*(E|_{U \cap V})
$$
where the second equality is part (1) of
Cohomology, Lemma \ref{cohomology-lemma-pushforward-restriction}.
This implies that $E = R(U \to X)_*E|_U$ (small detail omitted). If
this is the case then
$$
\Hom_{D(\mathcal{O}_X)}(Q[n], E) = \Hom_{D(\mathcal{O}_U)}(Q|_U[n], E|_U)
$$
which contains $\Hom_{D(\mathcal{O}_U)}(P[n], E|_U)$ as a direct summand.
Thus by our choice of $P$ the vanishing of these groups implies that $E|_U$
is zero. Whence $E$ is zero.
\end{proof}



\section{An example generator}
\label{section-example-generator}

\noindent
In this section we prove that the derived category of projective
space over a ring is generated by a vector bundle, in fact a direct
sum of shifts of the structure sheaf.

\medskip\noindent
The following lemma says that $\bigoplus_{n \geq 0} \mathcal{L}^{\otimes -n}$
is a generator if $\mathcal{L}$ is ample.

\begin{lemma}
\label{lemma-nonzero-some-cohomology}
Let $X$ be a scheme and $\mathcal{L}$ an ample invertible
$\mathcal{O}_X$-module. If $K$ is a nonzero object of
$D_\QCoh(\mathcal{O}_X)$, then for some $n \geq 0$ and $p \in \mathbf{Z}$
the cohomology group
$H^p(X, K \otimes_{\mathcal{O}_X}^\mathbf{L} \mathcal{L}^{\otimes n})$
is nonzero.
\end{lemma}

\begin{proof}
Recall that as $X$ has an ample invertible sheaf, it is quasi-compact
and separated (Properties, Definition \ref{properties-definition-ample} and
Lemma \ref{properties-lemma-affine-s-opens-cover-quasi-separated}).
Thus we may apply
Proposition \ref{proposition-quasi-compact-affine-diagonal}
and represent $K$ by a complex $\mathcal{F}^\bullet$ of
quasi-coherent modules. Pick any $p$ such that
$\mathcal{H}^p = \Ker(\mathcal{F}^p \to \mathcal{F}^{p + 1})/
\Im(\mathcal{F}^{p - 1} \to \mathcal{F}^p)$ is nonzero.
Choose a point $x \in X$ such that the stalk $\mathcal{H}^p_x$ is
nonzero. Choose an $n \geq 0$ and $s \in \Gamma(X, \mathcal{L}^{\otimes n})$
such that $X_s$ is an affine open neighbourhood of $x$.
Choose $\tau \in \mathcal{H}^p(X_s)$ which maps to a nonzero
element of the stalk $\mathcal{H}^p_x$; this is possible
as $\mathcal{H}^p$ is quasi-coherent and $X_s$ is affine.
Since taking sections over $X_s$ is an exact functor on
quasi-coherent modules, we can find a section $\tau' \in \mathcal{F}^p(X_s)$
mapping to zero in $\mathcal{F}^{p + 1}(X_s)$ and mapping to
$\tau$ in $\mathcal{H}^p(X_s)$. By
Properties, Lemma \ref{properties-lemma-invert-s-sections}
there exists an $m$ such that $\tau' \otimes s^{\otimes m}$
is the image of a section
$\tau'' \in \Gamma(X, \mathcal{F}^p \otimes \mathcal{L}^{\otimes mn})$.
Applying the same lemma once more, we find $l \geq 0$ such that
$\tau'' \otimes s^{\otimes l}$ maps to zero in
$\mathcal{F}^{p + 1} \otimes \mathcal{L}^{\otimes (m + l)n}$.
Then $\tau''$ gives a nonzero class in
$H^p(X, K \otimes^\mathbf{L}_{\mathcal{O}_X} \mathcal{L}^{(m + l)n})$
as desired.
\end{proof}

\begin{lemma}
\label{lemma-construct-the-next-one}
Let $A$ be a ring. Let $X = \mathbf{P}^n_A$. For every $a \in \mathbf{Z}$
there exists an exact complex
$$
0 \to \mathcal{O}_X(a) \to \ldots
\to \mathcal{O}_X(a + i)^{\oplus {n + 1 \choose i}} \to
\ldots \to \mathcal{O}_X(a + n + 1) \to 0
$$
of vector bundles on $X$.
\end{lemma}

\begin{proof}
Recall that $\mathbf{P}^n_A$ is $\text{Proj}(A[X_0, \ldots, X_n])$, see
Constructions, Definition \ref{constructions-definition-projective-space}.
Consider the Koszul complex
$$
K_\bullet = K_\bullet(A[X_0, \ldots, X_n], X_0, \ldots, X_n)
$$
over $S = A[X_0, \ldots, X_n]$ on $X_0, \ldots, X_n$.
Since $X_0, \ldots, X_n$ is clearly a regular sequence in the
polynomial ring $S$, we see that
(More on Algebra, Lemma \ref{more-algebra-lemma-regular-koszul-regular})
that the Koszul complex $K_\bullet$ is exact, except in degree $0$
where the cohomology is $S/(X_0, \ldots, X_n)$.
Note that $K_\bullet$ becomes a complex of graded modules if we
put the generators of $K_i$ in degree $+i$. In other words an
exact complex
$$
0 \to S(-n - 1) \to \ldots \to S(-n - 1 + i)^{\oplus {n \choose i}} \to \ldots
\to S \to S/(X_0, \ldots, X_n) \to 0
$$
Applying the exact functor $\tilde{\ }$ functor of Constructions, 
Lemma \ref{constructions-lemma-proj-sheaves} and using that
the last term is in the kernel of this functor,
we obtain the exact complex
$$
0 \to \mathcal{O}_X(-n - 1) \to \ldots
\to \mathcal{O}_X(-n - 1 + i)^{\oplus {n + 1 \choose i}} \to
\ldots \to \mathcal{O}_X \to 0
$$
Twisting by the invertible sheaves $\mathcal{O}_X(n + a + 1)$
we get the exact complexes of the lemma.
\end{proof}

\begin{lemma}
\label{lemma-generator-P1}
Let $A$ be a ring. Let $X = \mathbf{P}^n_A$. Then
$$
E =
\mathcal{O}_X \oplus \mathcal{O}_X(-1) \oplus \ldots \oplus \mathcal{O}_X(-n)
$$
is a generator
(Derived Categories, Definition \ref{derived-definition-generators})
of $D_\QCoh(X)$.
\end{lemma}

\begin{proof}
Let $K \in D_\QCoh(\mathcal{O}_X)$. Assume
$\Hom(E, K[p]) = 0$ for all $p \in \mathbf{Z}$.
We have to show that $K = 0$.
By Derived Categories, Lemma
\ref{derived-lemma-right-orthogonal}
we see that $\Hom(E', K[p])$ is zero for all $E' \in \langle E \rangle$
and $p \in \mathbf{Z}$.
By Lemma \ref{lemma-construct-the-next-one}
applied with $a = -n - 1$
we see that $\mathcal{O}_X(-n - 1) \in \langle E \rangle$
because it is quasi-isomorphic to a finite complex
whose terms are finite direct sums of summands of $E$.
Repeating the argument with $a = -n - 2$ we see that
$\mathcal{O}_X(-n - 2) \in \langle E \rangle$.
Arguing by induction we find that $\mathcal{O}_X(-m) \in \langle E \rangle$
for all $m \geq 0$.
Since
$$
\Hom(\mathcal{O}_X(-m), K[p]) =
H^p(X, K \otimes_{\mathcal{O}_X}^\mathbf{L} \mathcal{O}_X(m)) =
H^p(X, K \otimes_{\mathcal{O}_X}^\mathbf{L} \mathcal{O}_X(1)^{\otimes m})
$$
we conclude that $K = 0$ by Lemma \ref{lemma-nonzero-some-cohomology}.
(This also uses that $\mathcal{O}_X(1)$ is an ample
invertible sheaf on $X$ which follows from
Properties, Lemma \ref{properties-lemma-open-in-proj-ample}.)
\end{proof}

\begin{remark}
\label{remark-pullback-generator}
Let $f : X \to Y$ be a morphism of quasi-compact and quasi-separated schemes.
Let $E \in D_\QCoh(\mathcal{O}_Y)$ be a generator
(see Theorem \ref{theorem-bondal-van-den-Bergh}).
Then the following are equivalent
\begin{enumerate}
\item for $K \in D_\QCoh(\mathcal{O}_X)$ we have
$Rf_*K = 0$ if and only if $K = 0$,
\item $Rf_* : D_\QCoh(\mathcal{O}_X) \to D_\QCoh(\mathcal{O}_Y)$
reflects isomorphisms, and
\item $Lf^*E$ is a generator for $D_\QCoh(\mathcal{O}_X)$.
\end{enumerate}
The equivalence between (1) and (2) is a formal consequence of the fact that
$Rf_* : D_\QCoh(\mathcal{O}_X) \to D_\QCoh(\mathcal{O}_Y)$ is an
exact functor of triangulated categories. Similarly, the equivalence
between (1) and (3) follows formally from the fact that $Lf^*$
is the left adjoint to $Rf_*$.
These conditions hold if $f$ is affine (Lemma \ref{lemma-affine-morphism})
or if $f$ is an open immersion, or if $f$ is a composition of such.
We conclude that
\begin{enumerate}
\item if $X$ is a quasi-affine scheme then $\mathcal{O}_X$ is a generator
for $D_\QCoh(\mathcal{O}_X)$,
\item if $X \subset \mathbf{P}^n_A$ is a quasi-compact
locally closed subscheme, then
$\mathcal{O}_X \oplus \mathcal{O}_X(-1) \oplus \ldots \oplus \mathcal{O}_X(-n)$
is a generator for $D_\QCoh(\mathcal{O}_X)$ by
Lemma \ref{lemma-generator-P1}.
\end{enumerate}
\end{remark}




\section{Compact and perfect objects}
\label{section-compact}

\noindent
Let $X$ be a Noetherian scheme of finite dimension. By
Cohomology, Proposition \ref{cohomology-proposition-vanishing-Noetherian}
and
Cohomology on Sites, Lemma \ref{sites-cohomology-lemma-when-jshriek-compact}
the sheaves of modules $j_!\mathcal{O}_U$ are compact objects
of $D(\mathcal{O}_X)$ for all opens $U \subset X$.
These sheaves are typically not quasi-coherent, hence these
do not give perfect objects of the derived category $D(\mathcal{O}_X)$.
However, if we restrict ourselves to complexes with quasi-coherent
cohomology sheaves, then this does not happen.
Here is the precise statement.

\begin{proposition}
\label{proposition-compact-is-perfect}
Let $X$ be a quasi-compact and quasi-separated scheme.
An object of $D_\QCoh(\mathcal{O}_X)$ is compact
if and only if it is perfect.
\end{proposition}

\begin{proof}
If $K$ is a perfect object of $D(\mathcal{O}_X)$ with dual
$K^\vee$ (Cohomology, Lemma \ref{cohomology-lemma-dual-perfect-complex})
we have
$$
\Hom_{D(\mathcal{O}_X)}(K, M) =
H^0(X, K^\vee \otimes_{\mathcal{O}_X}^\mathbf{L} M)
$$
functorially in $M$. Since $K^\vee \otimes_{\mathcal{O}_X}^\mathbf{L} -$
commutes with direct sums and since $H^0(X, -)$ commutes with direct
sums on $D_\QCoh(\mathcal{O}_X)$ by
Lemma \ref{lemma-quasi-coherence-pushforward-direct-sums}
we conclude that $K$ is compact in $D_\QCoh(\mathcal{O}_X)$.

\medskip\noindent
Conversely, let $K$ be a compact object of $D_\QCoh(\mathcal{O}_X)$.
To show that $K$ is perfect, it suffices to show that
$K|_U$ is perfect for every affine open $U \subset X$, see
Cohomology, Lemma \ref{cohomology-lemma-perfect-independent-representative}.
Observe that $j : U \to X$ is a quasi-compact and separated morphism.
Hence
$Rj_* : D_\QCoh(\mathcal{O}_U) \to D_\QCoh(\mathcal{O}_X)$
commutes with direct sums, see
Lemma \ref{lemma-quasi-coherence-pushforward-direct-sums}.
Thus the adjointness of restriction to $U$ and $Rj_*$ implies that
$K|_U$ is a compact object of $D_\QCoh(\mathcal{O}_U)$.
Hence we reduce to the case that $X$ is affine.

\medskip\noindent
Assume $X = \Spec(A)$ is affine. By Lemma \ref{lemma-affine-compare-bounded}
the problem is translated into the same problem for $D(A)$.
For $D(A)$ the result is
More on Algebra, Proposition \ref{more-algebra-proposition-perfect-is-compact}.
\end{proof}

\begin{remark}
\label{remark-classical-generator}
Let $X$ be a quasi-compact and quasi-separated scheme. Let $G$ be a
perfect object of $D(\mathcal{O}_X)$ which is a generator for
$D_\QCoh(\mathcal{O}_X)$. By Theorem \ref{theorem-bondal-van-den-Bergh}
there is at least one of these. Combining
Lemma \ref{lemma-quasi-coherence-direct-sums} with
Proposition \ref{proposition-compact-is-perfect} and with
Derived Categories, Proposition
\ref{derived-proposition-generator-versus-classical-generator}
we see that $G$ is a classical generator for $D_{perf}(\mathcal{O}_X)$.
\end{remark}

\noindent
The following result is a strengthening of
Proposition \ref{proposition-compact-is-perfect}.
Let $T \subset X$ be a closed subset of a scheme $X$. As before
$D_T(\mathcal{O}_X)$ denotes the strictly full, saturated,
triangulated subcategory of $D(\mathcal{O}_X)$ consisting of objects
supported on $T$ (Definition \ref{definition-supported-on}).
Since taking direct sums commutes with taking cohomology sheaves, it follows
that $D_T(\mathcal{O}_X)$ has direct sums and that they are equal
to direct sums in $D(\mathcal{O}_X)$.

\begin{lemma}
\label{lemma-compact-is-perfect-with-support}
Let $X$ be a quasi-compact and quasi-separated scheme.
Let $T \subset X$ be a closed subset such that $X \setminus T$
is quasi-compact. An object of $D_{\QCoh, T}(\mathcal{O}_X)$ is compact
if and only if it is perfect as an object of $D(\mathcal{O}_X)$.
\end{lemma}

\begin{proof}
We observe that $D_{\QCoh, T}(\mathcal{O}_X)$ is a triangulated
category with direct sums by the remark preceding the lemma.
By Proposition \ref{proposition-compact-is-perfect}
the perfect objects define compact objects of $D(\mathcal{O}_X)$
hence a fortiori of any subcategory preserved under taking direct
sums. For the converse we will use there exists a generator
$E \in D_{\QCoh, T}(\mathcal{O}_X)$ which is a perfect complex
of $\mathcal{O}_X$-modules, see
Lemma \ref{lemma-generator-with-support}.
Hence by the above, $E$ is compact. Then it follows from
Derived Categories, Proposition
\ref{derived-proposition-generator-versus-classical-generator}
that $E$ is a classical generator of the full subcategory
of compact objects of $D_{\QCoh, T}(\mathcal{O}_X)$.
Thus any compact object can be constructed out of $E$ by
a finite sequence of operations consisting of
(a) taking shifts, (b) taking finite direct sums, (c) taking cones, and
(d) taking direct summands. Each of these operations preserves
the property of being perfect and the result follows.
\end{proof}

\begin{remark}
\label{remark-classical-generator-with-support}
Let $X$ be a quasi-compact and quasi-separated scheme.
Let $T \subset X$ be a closed subset such that $X \setminus T$
is quasi-compact. Let $G$ be a
perfect object of $D_{\QCoh, T}(\mathcal{O}_X)$ which is a generator for
$D_{\QCoh, T}(\mathcal{O}_X)$. By Lemma \ref{lemma-generator-with-support}
there is at least one of these. Combining the fact that
$D_{\QCoh, T}(\mathcal{O}_X)$ has direct sums with
Lemma \ref{lemma-compact-is-perfect-with-support} and with
Derived Categories, Proposition
\ref{derived-proposition-generator-versus-classical-generator}
we see that $G$ is a classical generator for $D_{perf, T}(\mathcal{O}_X)$.
\end{remark}

\noindent
The following lemma is an application of the ideas that go into
the proof of the preceding lemma.

\begin{lemma}
\label{lemma-map-from-pseudo-coherent-to-complex-with-support}
Let $X$ be a quasi-compact and quasi-separated scheme. Let $T \subset X$
be a closed subset such that $U = X \setminus T$ is quasi-compact.
Let $\alpha : P \to E$ be a morphism of $D_\QCoh(\mathcal{O}_X)$ with
either
\begin{enumerate}
\item $P$ is perfect and $E$ supported on $T$, or
\item $P$ pseudo-coherent, $E$ supported on $T$, and $E$ bounded below.
\end{enumerate}
Then there exists a perfect complex of $\mathcal{O}_X$-modules $I$
and a map $I \to \mathcal{O}_X[0]$ such that
$I \otimes^\mathbf{L} P \to E$ is zero and such that
$I|_U \to \mathcal{O}_U[0]$ is an
isomorphism.
\end{lemma}

\begin{proof}
Set $\mathcal{D} = D_{\QCoh, T}(\mathcal{O}_X)$. In both cases the complex
$K = R\SheafHom(P, E)$ is an object of $\mathcal{D}$. See
Lemma \ref{lemma-quasi-coherence-internal-hom} for quasi-coherence.
It is clear that $K$ is supported on $T$ as formation of $R\SheafHom$
commutes with restriction to opens.
The map $\alpha$ defines an element of
$H^0(K) = \Hom_{D(\mathcal{O}_X)}(\mathcal{O}_X[0], K)$.
Then it suffices to prove the result for the map
$\alpha : \mathcal{O}_X[0] \to K$.

\medskip\noindent
Let $E \in \mathcal{D}$ be a perfect generator, see
Lemma \ref{lemma-generator-with-support}. Write
$$
K = \text{hocolim} K_n
$$
as in Derived Categories, Lemma \ref{derived-lemma-write-as-colimit}
using the generator $E$. Since the functor $\mathcal{D} \to D(\mathcal{O}_X)$
commutes with direct sums, we see that $K = \text{hocolim} K_n$
holds in $D(\mathcal{O}_X)$. Since $\mathcal{O}_X$ is a compact
object of $D(\mathcal{O}_X)$ we find an $n$ and a morphism
$\alpha_n : \mathcal{O}_X \to K_n$ which gives rise to $\alpha$, see
Derived Categories, Lemma \ref{derived-lemma-commutes-with-countable-sums}.
By Derived Categories, Lemma \ref{derived-lemma-factor-through}
applied to the morphism $\mathcal{O}_X[0] \to K_n$ in the ambient
category $D(\mathcal{O}_X)$ we see that $\alpha_n$ factors as
$\mathcal{O}_X[0] \to Q \to K_n$ where $Q$ is an object
of $\langle E \rangle$. We conclude that $Q$ is a perfect complex
supported on $T$.

\medskip\noindent
Choose a distinguished triangle
$$
I \to \mathcal{O}_X[0] \to Q \to I[1]
$$
By construction $I$ is perfect, the map $I \to \mathcal{O}_X[0]$
restricts to an isomorphism over $U$, and the composition
$I \to K$ is zero as $\alpha$ factors through $Q$.
This proves the lemma.
\end{proof}






\section{Derived categories as module categories}
\label{section-derived-is-dga}

\noindent
In this section we draw some conclusions of what has gone before.
Before we do so we need a couple more lemmas.

\begin{lemma}
\label{lemma-tensor-with-QCoh-complex}
Let $X$ be a scheme. Let $K^\bullet$ be a complex of $\mathcal{O}_X$-modules
whose cohomology sheaves are quasi-coherent. Let
$(E, d) = \Hom_{\text{Comp}^{dg}(\mathcal{O}_X)}(K^\bullet, K^\bullet)$
be the endomorphism differential graded algebra. Then the functor
$$
- \otimes_E^\mathbf{L} K^\bullet :
D(E, \text{d}) \longrightarrow D(\mathcal{O}_X)
$$
of
Differential Graded Algebra, Lemma
\ref{dga-lemma-tensor-with-complex-derived}
has image contained in $D_\QCoh(\mathcal{O}_X)$.
\end{lemma}

\begin{proof}
Let $P$ be a differential graded $E$-module with property (P)
and let $F_\bullet$ be a filtration on $P$ as in
Differential Graded Algebra, Section \ref{dga-section-P-resolutions}.
Then we have
$$
P \otimes_E K^\bullet = \text{hocolim}\ F_iP \otimes_E K^\bullet
$$
Each of the $F_iP$ has a finite filtration whose graded pieces
are direct sums of $E[k]$. The result follows easily.
\end{proof}

\noindent
The following result is taken from \cite{BvdB}.

\begin{theorem}
\label{theorem-DQCoh-is-Ddga}
Let $X$ be a quasi-compact and quasi-separated scheme.
Then there exist a differential graded algebra $(E, \text{d})$
with only a finite number of nonzero cohomology groups $H^i(E)$
such that $D_\QCoh(\mathcal{O}_X)$ is equivalent
to $D(E, \text{d})$.
\end{theorem}

\begin{proof}
Let $K^\bullet$ be a K-injective complex of $\mathcal{O}$-modules which
is perfect and generates $D_\QCoh(\mathcal{O}_X)$. Such a
thing exists by Theorem \ref{theorem-bondal-van-den-Bergh}
and the existence of K-injective resolutions. We will show the
theorem holds with
$$
(E, \text{d}) = \Hom_{\text{Comp}^{dg}(\mathcal{O}_X)}(K^\bullet, K^\bullet)
$$
where $\text{Comp}^{dg}(\mathcal{O}_X)$ is the differential graded category
of complexes of $\mathcal{O}$-modules. Please see
Differential Graded Algebra, Section \ref{dga-section-variant-base-change}.
Since $K^\bullet$ is K-injective we
have
\begin{equation}
\label{equation-E-is-OK}
H^n(E) = \Ext^n_{D(\mathcal{O}_X)}(K^\bullet, K^\bullet)
\end{equation}
for all $n \in \mathbf{Z}$. Only a finite number of these Exts
are nonzero by Lemma \ref{lemma-ext-from-perfect-into-bounded-QCoh}.
Consider the functor
$$
- \otimes_E^\mathbf{L} K^\bullet :
D(E, \text{d}) \longrightarrow D(\mathcal{O}_X)
$$
of
Differential Graded Algebra, Lemma
\ref{dga-lemma-tensor-with-complex-derived}.
Since $K^\bullet$ is perfect, it defines a compact object of
$D(\mathcal{O}_X)$, see Proposition \ref{proposition-compact-is-perfect}.
Combined with (\ref{equation-E-is-OK}) the functor above is fully
faithful as follows from
Differential Graded Algebra, Lemmas
\ref{dga-lemma-fully-faithful-in-compact-case}. It has a right adjoint
$$
R\Hom(K^\bullet, - ) : D(\mathcal{O}_X) \longrightarrow D(E, \text{d})
$$
by Differential Graded Algebra, Lemmas
\ref{dga-lemma-tensor-with-complex-hom-adjoint}
which is a left quasi-inverse functor by generalities on adjoint
functors. On the other hand, it follows from
Lemma \ref{lemma-tensor-with-QCoh-complex} that we obtain
$$
- \otimes_E^\mathbf{L} K^\bullet :
D(E, \text{d}) \longrightarrow D_\QCoh(\mathcal{O}_X)
$$
and by our choice of $K^\bullet$ as a generator of
$D_\QCoh(\mathcal{O}_X)$ the kernel of the adjoint
restricted to $D_\QCoh(\mathcal{O}_X)$ is zero.
A formal argument shows that we obtain the desired equivalence, see
Derived Categories, Lemma
\ref{derived-lemma-fully-faithful-adjoint-kernel-zero}.
\end{proof}

\begin{remark}[Variant with support]
\label{remark-DQCoh-is-Ddga-with-support}
Let $X$ be a quasi-compact and quasi-separated scheme. Let $T \subset X$
be a closed subset such that $X \setminus T$ is quasi-compact.
The analogue of Theorem \ref{theorem-DQCoh-is-Ddga} holds
for $D_{\QCoh, T}(\mathcal{O}_X)$.
This follows from the exact same argument as in the proof
of the theorem, using
Lemmas \ref{lemma-generator-with-support} and
\ref{lemma-compact-is-perfect-with-support}
and a variant of Lemma \ref{lemma-tensor-with-QCoh-complex}
with supports.
If we ever need this, we will precisely state the
result here and give a detailed proof.
\end{remark}

\begin{remark}[Uniqueness of dga]
\label{remark-independence-choice}
Let $X$ be a quasi-compact and quasi-separated scheme over a ring $R$.
By the construction of the proof of
Theorem \ref{theorem-DQCoh-is-Ddga}
there exists a differential graded algebra $(A, \text{d})$ over $R$
such that $D_\QCoh(X)$ is $R$-linearly equivalent to
$D(A, \text{d})$ as a triangulated category.
One may ask: how unique is $(A, \text{d})$?
The answer is (only) slightly better than just saying that
$(A, \text{d})$ is well defined up to derived equivalence.
Namely, suppose that $(B, \text{d})$ is a second such pair.
Then we have
$$
(A, \text{d}) = \Hom_{\text{Comp}^{dg}(\mathcal{O}_X)}(K^\bullet, K^\bullet)
$$
and
$$
(B, \text{d}) = \Hom_{\text{Comp}^{dg}(\mathcal{O}_X)}(L^\bullet, L^\bullet)
$$
for some K-injective complexes $K^\bullet$ and $L^\bullet$
of $\mathcal{O}_X$-modules corresponding to perfect generators
of $D_\QCoh(\mathcal{O}_X)$. Set
$$
\Omega = \Hom_{\text{Comp}^{dg}(\mathcal{O}_X)}(K^\bullet, L^\bullet)
\quad
\Omega' = \Hom_{\text{Comp}^{dg}(\mathcal{O}_X)}(L^\bullet, K^\bullet)
$$
Then $\Omega$ is a differential graded $B^{opp} \otimes_R A$-module
and $\Omega'$ is a differential graded $A^{opp} \otimes_R B$-module.
Moreover, the equivalence
$$
D(A, \text{d}) \to D_\QCoh(\mathcal{O}_X) \to
D(B, \text{d})
$$
is given by the functor $- \otimes_A^\mathbf{L} \Omega'$ and
similarly for the quasi-inverse. Thus we are in the situation
of Differential Graded Algebra, Remark \ref{dga-remark-hochschild-cohomology}.
If we ever need this remark we will provide a precise statement
with a detailed proof here.
\end{remark}






\section{Characterizing pseudo-coherent complexes, I}
\label{section-pseudo-coherent-hocolim}

\noindent
We can use the methods above to characterize pseudo-coherent
objects as derived homotopy limits of approximations by perfect objects.

\begin{lemma}
\label{lemma-pseudo-coherent-hocolim}
Let $X$ be a quasi-compact and quasi-separated scheme.
Let $K \in D(\mathcal{O}_X)$. The following are equivalent
\begin{enumerate}
\item $K$ is pseudo-coherent, and
\item $K = \text{hocolim} K_n$ where
$K_n$ is perfect and $\tau_{\geq -n}K_n \to \tau_{\geq -n}K$
is an isomorphism for all $n$.
\end{enumerate}
\end{lemma}

\begin{proof}
The implication (2) $\Rightarrow$ (1) is true on any ringed space.
Namely, assume (2) holds. Recall that a perfect object of the derived
category is pseudo-coherent, see
Cohomology, Lemma \ref{cohomology-lemma-perfect}.
Then it follows from the definitions that
$\tau_{\geq -n}K_n$ is $(-n + 1)$-pseudo-coherent
and hence $\tau_{\geq -n}K$ is $(-n + 1)$-pseudo-coherent,
hence $K$ is $(-n + 1)$-pseudo-coherent. This is true for
all $n$, hence $K$ is pseudo-coherent, see
Cohomology, Definition \ref{cohomology-definition-pseudo-coherent}.

\medskip\noindent
Assume (1). We start by choosing an approximation
$K_1 \to K$ of $(X, K, -2)$ by a perfect complex $K_1$, see
Definitions \ref{definition-approximation-holds} and
\ref{definition-approximation} and
Theorem \ref{theorem-approximation}.
Suppose by induction we have
$$
K_1 \to K_2 \to \ldots \to K_n \to K
$$
with $K_i$ perfect such that
such that $\tau_{\geq -i}K_i \to \tau_{\geq -i}K$ is an isomorphism
for all $1 \leq i \leq n$. Then we pick $a \leq b$ as in
Lemma \ref{lemma-ext-from-perfect-into-bounded-QCoh}
for the perfect object $K_n$. Choose an approximation
$K_{n + 1} \to K$ of $(X, K, \min(a - 1, -n - 1))$.
Choose a distinguished triangle
$$
K_{n + 1} \to K \to C \to K_{n + 1}[1]
$$
Then we see that $C \in D_\QCoh(\mathcal{O}_X)$ has
$H^i(C) = 0$ for $i \geq a$. Thus by our choice of $a, b$
we see that $\Hom_{D(\mathcal{O}_X)}(K_n, C) = 0$.
Hence the composition $K_n \to K \to C$ is zero. Hence by
Derived Categories, Lemma \ref{derived-lemma-representable-homological}
we can factor $K_n \to K$ through $K_{n + 1}$
proving the induction step.

\medskip\noindent
We still have to prove that $K = \text{hocolim} K_n$.
This follows by an application of
Derived Categories, Lemma \ref{derived-lemma-cohomology-of-hocolim}
to the functors
$H^i( - ) : D(\mathcal{O}_X) \to \textit{Mod}(\mathcal{O}_X)$
and our choice of $K_n$.
\end{proof}

\begin{lemma}
\label{lemma-pseudo-coherent-hocolim-with-support}
Let $X$ be a quasi-compact and quasi-separated scheme.
Let $T \subset X$ be a closed subset such that $X \setminus T$
is quasi-compact. Let $K \in D(\mathcal{O}_X)$ supported on $T$.
The following are equivalent
\begin{enumerate}
\item $K$ is pseudo-coherent, and
\item $K = \text{hocolim} K_n$ where
$K_n$ is perfect, supported on $T$, and
$\tau_{\geq -n}K_n \to \tau_{\geq -n}K$ is an isomorphism for all $n$.
\end{enumerate}
\end{lemma}

\begin{proof}
The proof of this lemma is exactly the same as the proof of
Lemma \ref{lemma-pseudo-coherent-hocolim}
except that in the choice of the approximations we use
the triples $(T, K, m)$.
\end{proof}









\section{An example equivalence}
\label{section-example-equivalence}

\noindent
In Section \ref{section-example-generator}
we proved that the derived category of projective space $\mathbf{P}^n_A$
over a ring $A$ is generated by a vector bundle, in fact a direct
sum of shifts of the structure sheaf. In this section we prove this
determines an equivalence of $D_\QCoh(\mathcal{O}_{\mathbf{P}^n_A})$
with the derived category of an $A$-algebra.

\medskip\noindent
Before we can state the result we need some notation.
Let $A$ be a ring. Let $X = \mathbf{P}^n_A = \text{Proj}(S)$
where $S = A[X_0, \ldots, X_n]$. By Lemma \ref{lemma-generator-P1}
we know that
\begin{equation}
\label{equation-generator-Pn}
P =
\mathcal{O}_X \oplus \mathcal{O}_X(-1) \oplus \ldots \oplus \mathcal{O}_X(-n)
\end{equation}
is a perfect generator of $D_\QCoh(\mathcal{O}_X)$.
Consider the (noncommutative) $A$-algebra
\begin{equation}
\label{equation-algebra-for-Pn}
R = \Hom_{\mathcal{O}_X}(P, P) =
\left(
\begin{matrix}
S_0 & S_1 & S_2 & \ldots & \ldots \\
0 & S_0 & S_1 & \ldots & \ldots\\
0 & 0 & S_0 & \ldots & \ldots \\
\ldots & \ldots & \ldots & \ldots & \ldots \\
0 & \ldots & \ldots & \ldots & S_0
\end{matrix}
\right)
\end{equation}
with obvious multiplication and addition. If we view $P$ as a complex
of $\mathcal{O}_X$-modules in the usual way (i.e., with $P$ in degree $0$
and zero in every other degree), then we have
$$
R = \Hom_{\text{Comp}^{dg}(\mathcal{O}_X)}(P, P)
$$
where on the right hand side we view $R$ as a differential graded algebra
over $A$
with zero differential (i.e., with $R$ in degree $0$ and zero in every
other degree). According to the discussion in
Differential Graded Algebra, Section \ref{dga-section-variant-base-change}
we obtain a derived functor
$$
- \otimes_R^\mathbf{L} P : D(R) \longrightarrow D(\mathcal{O}_X),
$$
see especially Differential Graded Algebra, Lemma
\ref{dga-lemma-tensor-with-complex-derived}.
By Lemma \ref{lemma-tensor-with-QCoh-complex}
we see that the essential image of this functor
is contained in $D_\QCoh(\mathcal{O}_X)$.

\begin{lemma}
\label{lemma-Pn-module-category}
\begin{reference}
\cite{Beilinson}
\end{reference}
Let $A$ be a ring. Let $X = \mathbf{P}^n_A = \text{Proj}(S)$
where $S = A[X_0, \ldots, X_n]$. With
$P$ as in (\ref{equation-generator-Pn}) and
$R$ as in (\ref{equation-algebra-for-Pn})
the functor
$$
- \otimes_R^\mathbf{L} P : D(R) \longrightarrow D_\QCoh(\mathcal{O}_X)
$$
is an $A$-linear equivalence of triangulated categories sending $R$
to $P$.
\end{lemma}

\noindent
In words: the derived category of quasi-coherent modules on
projective space is equivalent to the derived category of modules
over a (noncommutative) algebra.
This property of projective space appears to be quite unusual among
all projective schemes over $A$.

\begin{proof}
To prove that our functor is fully faithful it suffices to prove
that $\Ext^i_X(P, P)$ is zero for $i \not = 0$ and equal
to $R$ for $i = 0$, see
Differential Graded Algebra, Lemma
\ref{dga-lemma-fully-faithful-in-compact-case}.
As in the proof of
Lemma \ref{lemma-ext-from-perfect-into-bounded-QCoh}
we see that
$$
\Ext^i_X(P, P) = H^i(X, P^\wedge \otimes P) =
\bigoplus\nolimits_{0 \leq a, b \leq n} H^i(X, \mathcal{O}_X(a - b))
$$
By the computation of cohomology of projective space
(Cohomology of Schemes, Lemma
\ref{coherent-lemma-cohomology-projective-space-over-ring})
we find that
these $\Ext$-groups are zero unless $i = 0$.
For $i = 0$ we recover $R$ because this is how we defined $R$
in (\ref{equation-algebra-for-Pn}).
By Differential Graded Algebra, Lemma
\ref{dga-lemma-tensor-with-complex-hom-adjoint}
our functor has a right adjoint, namely
$R\Hom(P, -) : D_\QCoh(\mathcal{O}_X) \to D(R)$.
Since $P$ is a generator for $D_\QCoh(\mathcal{O}_X)$ by
Lemma \ref{lemma-generator-P1}
we see that the kernel of $R\Hom(P, -)$ is zero.
Hence our functor is an equivalence of triangulated
categories by Derived Categories, Lemma
\ref{derived-lemma-fully-faithful-adjoint-kernel-zero}.
\end{proof}






\section{The coherator revisited}
\label{section-better-coherator}

\noindent
In Section \ref{section-coherator} we constructed and studied
the right adjoint $RQ_X$ to the canonical functor
$D(\QCoh(\mathcal{O}_X)) \to D(\mathcal{O}_X)$.
It was constructed as the right derived extension of the coherator
$Q_X : \textit{Mod}(\mathcal{O}_X) \to \QCoh(\mathcal{O}_X)$.
In this section, we study when the inclusion functor
$$
D_\QCoh(\mathcal{O}_X) \longrightarrow D(\mathcal{O}_X)
$$
has a right adjoint. If this right adjoint exists, we will
denote\footnote{This is probably nonstandard notation. However, we have already
used $Q_X$ for the coherator and $RQ_X$ for its derived extension.} it
$$
DQ_X :
D(\mathcal{O}_X) \longrightarrow D_\QCoh(\mathcal{O}_X)
$$
It turns out that quasi-compact and quasi-separated
schemes have such a right adjoint.

\begin{lemma}
\label{lemma-better-coherator}
Let $X$ be a quasi-compact and quasi-separated scheme.
The inclusion functor $D_\QCoh(\mathcal{O}_X) \to D(\mathcal{O}_X)$
has a right adjoint $DQ_X$.
\end{lemma}

\begin{proof}[First proof]
We will use the induction principle as in
Cohomology of Schemes, Lemma \ref{coherent-lemma-induction-principle}
to prove this. If $D(\QCoh(\mathcal{O}_X)) \to D_\QCoh(\mathcal{O}_X)$
is an equivalence, then the lemma is true because the functor
$RQ_X$ of Section \ref{section-coherator} is a right adjoint to the functor
$D(\QCoh(\mathcal{O}_X)) \to D(\mathcal{O}_X)$.
In particular, our lemma is true for affine schemes, see
Lemma \ref{lemma-affine-coherator}.
Thus we see that it suffices to show: if $X = U \cup V$
is a union of two quasi-compact opens and the
lemma holds for $U$, $V$, and $U \cap V$, then the lemma holds for $X$.

\medskip\noindent
The adjoint exists if and only if for every object $K$ of
$D(\mathcal{O}_X)$ we can find a distinguished triangle
$$
E' \to E \to K \to E'[1]
$$
in $D(\mathcal{O}_X)$
such that $E'$ is in $D_\QCoh(\mathcal{O}_X)$ and such that
$\Hom(M, K) = 0$ for all $M$ in $D_\QCoh(\mathcal{O}_X)$. See
Derived Categories, Lemma \ref{derived-lemma-right-adjoint}.
Consider the distinguished triangle
$$
E \to Rj_{U, *}E|_U \oplus Rj_{V, *}E|_V \to
Rj_{U \cap V, *}E|_{U \cap V} \to E[1]
$$
in $D(\mathcal{O}_X)$ of
Cohomology, Lemma \ref{cohomology-lemma-exact-sequence-j-star}.
By Derived Categories, Lemma \ref{derived-lemma-prepare-adjoint}
it suffices to construct the desired distinguished triangles
for $Rj_{U, *}E|_U$, $Rj_{V, *}E|_V$, and
$Rj_{U \cap V, *}E|_{U \cap V}$. This reduces us to the statement
discussed in the next paragraph.

\medskip\noindent
Let $j : U \to X$ be an open immersion corresponding with $U$ a quasi-compact
open for which the lemma is true. Let $L$ be an object of $D(\mathcal{O}_U)$.
Then there exists a distinguished triangle
$$
E' \to Rj_*L \to K \to E'[1]
$$
in $D(\mathcal{O}_X)$
such that $E'$ is in $D_\QCoh(\mathcal{O}_X)$ and such that
$\Hom(M, K) = 0$ for all $M$ in $D_\QCoh(\mathcal{O}_X)$.
To see this we choose a distinguished triangle
$$
L' \to L \to Q \to L'[1]
$$
in $D(\mathcal{O}_U)$ such that $L'$ is in $D_\QCoh(\mathcal{O}_U)$
and such that $\Hom(N, Q) = 0$ for all $N$ in $D_\QCoh(\mathcal{O}_U)$.
This is possible because the statement in
Derived Categories, Lemma \ref{derived-lemma-right-adjoint}
is an if and only if.
We obtain a distinguished triangle
$$
Rj_*L' \to Rj_*L \to Rj_*Q \to Rj_*L'[1]
$$
in $D(\mathcal{O}_X)$. Observe that $Rj_*L'$ is in $D_\QCoh(\mathcal{O}_X)$
by Lemma \ref{lemma-quasi-coherence-direct-image}.
On the other hand, if $M$ in $D_\QCoh(\mathcal{O}_X)$, then
$$
\Hom(M, Rj_*Q) = \Hom(Lj^*M, Q) = 0
$$
because $Lj^*M$ is in $D_\QCoh(\mathcal{O}_U)$ by
Lemma \ref{lemma-quasi-coherence-pullback}.
This finishes the proof.
\end{proof}

\begin{proof}[Second proof]
The adjoint exists by Derived Categories, Proposition
\ref{derived-proposition-brown}. The hypotheses are satisfied:
First, note that $D_\QCoh(\mathcal{O}_X)$ has direct sums
and direct sums commute with the inclusion functor
(Lemma \ref{lemma-quasi-coherence-direct-sums}).
On the other hand, $D_\QCoh(\mathcal{O}_X)$
is compactly generated because it has a perfect
generator Theorem \ref{theorem-bondal-van-den-Bergh}
and because perfect objects are compact by
Proposition \ref{proposition-compact-is-perfect}.
\end{proof}

\begin{lemma}
\label{lemma-pushforward-better-coherator}
Let $f : X \to Y$ be a quasi-compact and quasi-separated
morphism of schemes. If the right adjoints $DQ_X$ and $DQ_Y$
of the inclusion functors $D_\QCoh \to D$ exist for $X$ and $Y$, then
$$
Rf_* \circ DQ_X = DQ_Y \circ Rf_*
$$
\end{lemma}

\begin{proof}
The statement makes sense because $Rf_*$ sends
$D_\QCoh(\mathcal{O}_X)$ into $D_\QCoh(\mathcal{O}_Y)$ by
Lemma \ref{lemma-quasi-coherence-direct-image}.
The statement is true because $Lf^*$ similarly maps
$D_\QCoh(\mathcal{O}_Y)$ into $D_\QCoh(\mathcal{O}_X)$
(Lemma \ref{lemma-quasi-coherence-pullback})
and hence both $Rf_* \circ DQ_X$ and $DQ_Y \circ Rf_*$
are right adjoint to $Lf^* : D_\QCoh(\mathcal{O}_Y) \to D(\mathcal{O}_X)$.
\end{proof}

\begin{remark}
\label{remark-explain-consequence}
Let $X$ be a quasi-compact and quasi-separated scheme.
Let $X = U \cup V$ with $U$ and $V$ quasi-compact open.
By Lemma \ref{lemma-better-coherator} the functors
$DQ_X$, $DQ_U$, $DQ_V$, $DQ_{U \cap V}$ exist. Moreover, there is a
canonical distinguished triangle
$$
DQ_X(K) \to Rj_{U, *}DQ_U(K|_U) \oplus Rj_{V, *}DQ_V(K|_V)
\to Rj_{U \cap V, *}DQ_{U \cap V}(K|_{U \cap V}) \to
$$
for any $K \in D(\mathcal{O}_X)$. This follows by applying the
exact functor $DQ_X$ to the distinguished triangle of
Cohomology, Lemma \ref{cohomology-lemma-exact-sequence-j-star}
and using Lemma \ref{lemma-pushforward-better-coherator} three times.
\end{remark}

\begin{lemma}
\label{lemma-boundedness-better-coherator}
Let $X$ be a quasi-compact and quasi-separated scheme. The functor
$DQ_X$ of Lemma \ref{lemma-better-coherator}
has the following boundedness property:
there exists an integer $N = N(X)$ such that, if
$K$ in $D(\mathcal{O}_X)$ with
$H^i(U, K) = 0$ for $U$ affine open in $X$ and $i \not \in [a, b]$, then
the cohomology sheaves $H^i(DQ_X(K))$ are zero for
$i \not \in [a, b + N]$.
\end{lemma}

\begin{proof}
We will prove this using the induction principle of
Cohomology of Schemes, Lemma \ref{coherent-lemma-induction-principle}.

\medskip\noindent
If $X$ is affine, then the lemma is true with $N = 0$ because then
$RQ_X = DQ_X$ is given by taking the complex of
quasi-coherent sheaves associated to $R\Gamma(X, K)$.
See Lemmas \ref{lemma-affine-compare-bounded} and \ref{lemma-affine-coherator}.

\medskip\noindent
Assume $U, V$ are quasi-compact open in $X$
and the lemma holds for $U$, $V$, and $U \cap V$.
Say with integers $N(U)$, $N(V)$, and $N(U \cap V)$.
Now suppose $K$ is in $D(\mathcal{O}_X)$ with
$H^i(W, K) = 0$ for all affine open $W \subset X$ and all $i \not \in [a, b]$.
Then $K|_U$, $K|_V$, $K|_{U \cap V}$ have the same property.
Hence we see that $RQ_U(K|_U)$ and $RQ_V(K|_V)$ and
$RQ_{U \cap V}(K|_{U \cap V})$ have vanishing cohomology
sheaves outside the interval $[a, b + \max(N(U), N(V), N(U \cap V))$.
Since the functors $Rj_{U, *}$, $Rj_{V, *}$, $Rj_{U \cap V, *}$
have finite cohomological dimension on $D_\QCoh$ by
Lemma \ref{lemma-quasi-coherence-direct-image}
we see that there exists an $N$ such that
$Rj_{U, *}DQ_U(K|_U)$, $Rj_{V, *}DQ_V(K|_V)$, and
$Rj_{U \cap V, *}DQ_{U \cap V}(K|_{U \cap V})$ have vanishing
cohomology sheaves outside the interval $[a, b + N]$.
Then finally we conclude by the distinguished triangle
of Remark \ref{remark-explain-consequence}.
\end{proof}

\begin{example}
\label{example-inverse-limit-quasi-coherent}
Let $X$ be a quasi-compact and quasi-separated scheme. Let $(\mathcal{F}_n)$
be an inverse system of quasi-coherent sheaves. Since $DQ_X$ is a right
adjoint it commutes with products and therefore with derived limits.
Hence we see that
$$
DQ_X(R\lim \mathcal{F}_n) =
(R\lim\text{ in }D_\QCoh(\mathcal{O}_X))(\mathcal{F}_n)
$$
where the first $R\lim$ is taken in $D(\mathcal{O}_X)$.
In fact, let's write $K = R\lim \mathcal{F}_n$ for this.
For any affine open $U \subset X$ we have
$$
H^i(U, K) =
H^i(R\Gamma(U, R\lim \mathcal{F}_n)) =
H^i(R\lim R\Gamma(U, \mathcal{F}_n)) =
H^i(R\lim \Gamma(U, \mathcal{F}_n))
$$
since cohomology commutes with derived limits and since
the quasi-coherent sheaves
$\mathcal{F}_n$ have no higher cohomology on affines.
By the computation of $R\lim$ in the category of
abelian groups, we see that $H^i(U, K) = 0$
unless $i \in [0, 1]$. Then finally we conclude that
the $R\lim$ in $D_\QCoh(\mathcal{O}_X)$, which is
$DQ_X(K)$ by the above, is in $D^b_\QCoh(\mathcal{O}_X)$
by Lemma \ref{lemma-boundedness-better-coherator}.
\end{example}













\section{Cohomology and base change, IV}
\label{section-cohomology-and-base-change-perfect}

\noindent
This section continues the discussion of
Cohomology of Schemes, Section
\ref{coherent-section-cohomology-and-base-change-perfect}.
First, we have a very general version of the projection
formula for quasi-compact and quasi-separated morphisms of schemes 
and complexes with quasi-coherent cohomology sheaves.

\begin{lemma}
\label{lemma-cohomology-base-change}
Let $f : X \to Y$ be a quasi-compact and quasi-separated morphism
of schemes. For $E$ in $D_\QCoh(\mathcal{O}_X)$ and
$K$ in $D_\QCoh(\mathcal{O}_Y)$ the map
$$
Rf_*(E) \otimes_{\mathcal{O}_Y}^\mathbf{L} K
\longrightarrow
Rf_*(E \otimes_{\mathcal{O}_X}^\mathbf{L} Lf^*K)
$$
defined in
Cohomology, Equation (\ref{cohomology-equation-projection-formula-map})
is an isomorphism.
\end{lemma}

\begin{proof}
To check the map is an isomorphism we may work locally on $Y$.
Hence we reduce to the case that $Y$ is affine.

\medskip\noindent
Suppose that $K = \bigoplus K_i$ is a direct
sum of some complexes $K_i \in D_\QCoh(\mathcal{O}_Y)$.
If the statement holds for each $K_i$, then it holds for $K$.
Namely, the functors $Lf^*$ and $\otimes^\mathbf{L}$ preserve
direct sums by construction and $Rf_*$ commutes with direct sums
(for complexes with quasi-coherent cohomology sheaves) by
Lemma \ref{lemma-quasi-coherence-pushforward-direct-sums}.
Moreover, suppose that $K \to L \to M \to K[1]$ is a distinguished
triangle in $D_\QCoh(Y)$. Then if the statement of the
lemma holds for two of $K, L, M$, then it holds for the third
(as the functors involved are exact functors of triangulated categories).

\medskip\noindent
Assume $Y$ affine, say $Y = \Spec(A)$. The functor
$\widetilde{\ } : D(A) \to D_\QCoh(\mathcal{O}_Y)$ is an equivalence
(Lemma \ref{lemma-affine-compare-bounded}).
Let $T$ be the property for $K \in D(A)$ that
the statement of the lemma holds for $\widetilde{K}$.
The discussion above and
More on Algebra, Remark \ref{more-algebra-remark-P-resolution}
shows that it suffices to prove $T$ holds for $A[k]$.
This finishes the proof, as the statement of the lemma
is clear for shifts of the structure sheaf.
\end{proof}

\begin{definition}
\label{definition-tor-independent}
Let $S$ be a scheme. Let $X$, $Y$ be schemes over $S$. We say $X$ and
$Y$ are {\it Tor independent over $S$} if for every $x \in X$ and
$y \in Y$ mapping to the same point $s \in S$ the rings
$\mathcal{O}_{X, x}$ and $\mathcal{O}_{Y, y}$ are Tor independent
over $\mathcal{O}_{S, s}$ (see
More on Algebra, Definition \ref{more-algebra-definition-tor-independent}).
\end{definition}

\begin{lemma}
\label{lemma-tor-independent}
Let $f : X \to S$ and $g : Y \to S$ be morphisms of schemes.
The following are equivalent
\begin{enumerate}
\item $X$ and $Y$ are tor independent over $S$, and
\item for every affine opens $U \subset X$, $V \subset Y$, $W \subset S$
with $f(U) \subset W$ and $g(V) \subset W$ the rings
$\mathcal{O}_X(U)$ and $\mathcal{O}_Y(V)$ are tor independent over
$\mathcal{O}_S(W)$.
\item there exists an affine open overing $S = \bigcup W_i$ and
for each $i$ affine open coverings $f^{-1}(W_i) = \bigcup U_{ij}$
and $g^{-1}(W_i) = \bigcup V_{ik}$ such that the rings
$\mathcal{O}_X(U_{ij})$ and $\mathcal{O}_Y(V_{ik})$ are tor independent over
$\mathcal{O}_S(W_i)$ for all $i, j, k$.
\end{enumerate}
\end{lemma}

\begin{proof}
Omitted. Hint: use More on Algebra, Lemma
\ref{more-algebra-lemma-tor-independent}.
\end{proof}

\begin{lemma}
\label{lemma-flat-base-change-tor-independent}
Let $X \to S$ and $Y \to S$ be morphisms of schemes. Let $S' \to S$ be a
morphism of schemes and denote $X' = X \times_S S'$
and $Y' = Y \times_S S'$.
If $X$ and $Y$ are tor independent over $S$ and $S' \to S$ is flat,
then $X'$ and $Y'$ are tor independent over $S'$.
\end{lemma}

\begin{proof}
Omitted. Hint: use Lemma \ref{lemma-tor-independent} and
on affine opens use More on Algebra, Lemma
\ref{more-algebra-lemma-flat-base-change-tor-independent}.
\end{proof}

\begin{lemma}
\label{lemma-compare-base-change}
Let $g : S' \to S$ be a morphism of schemes.
Let $f : X \to S$ be quasi-compact and quasi-separated.
Consider the base change diagram
$$
\xymatrix{
X' \ar[r]_{g'} \ar[d]_{f'} &
X \ar[d]^f \\
S' \ar[r]^g &
S
}
$$
If $X$ and $S'$ are Tor independent over $S$, then for all
$E \in D_\QCoh(\mathcal{O}_X)$ the canonical arrow
$Lg^*Rf_*E \to Rf'_*L(g')^*E$ is an isomorphism.
\end{lemma}

\begin{proof}
For any object $E$ of $D(\mathcal{O}_X)$ we can use
Cohomology, Remark \ref{cohomology-remark-base-change} to get a
canonical base change map $Lg^*Rf_*E \to Rf'_*L(g')^*E$. To check this
is an isomorphism we may work locally on $S'$. Hence we may assume
$g : S' \to S$ is a morphism of affine schemes. In particular, $g$
is affine and it suffices to show that
$$
Rg_*Lg^*Rf_*E \to Rg_*Rf'_*L(g')^*E = Rf_*(Rg'_* L(g')^* E)
$$
is an isomorphism, see Lemma \ref{lemma-affine-morphism}
(and use Lemmas \ref{lemma-quasi-coherence-pullback},
\ref{lemma-quasi-coherence-tensor-product}, and
\ref{lemma-quasi-coherence-direct-image}
to see that the objects $Rf'_*L(g')^*E$ and $Lg^*Rf_*E$
have quasi-coherent cohomology sheaves). Note that $g'$ is
affine as well (Morphisms, Lemma \ref{morphisms-lemma-base-change-affine}).
By Lemma \ref{lemma-affine-morphism-pull-push} the map becomes a map
$$
Rf_*E \otimes_{\mathcal{O}_S}^\mathbf{L} g_*\mathcal{O}_{S'}
\longrightarrow
Rf_*(E \otimes_{\mathcal{O}_X}^\mathbf{L} g'_*\mathcal{O}_{X'})
$$
Observe that $g'_*\mathcal{O}_{X'} = f^*g_*\mathcal{O}_{S'}$ (by affine
base change, see Cohomology of Schemes, Lemma
\ref{coherent-lemma-affine-base-change}).
Thus by
Lemma \ref{lemma-cohomology-base-change} it suffices to prove that
$Lf^*g_*\mathcal{O}_{S'} = f^*g_*\mathcal{O}_{S'}$. This follows from our
assumption that $X$ and $S'$ are Tor independent over $S$. Namely, to
check it we may work locally on $X$, hence we may also assume $X$ is affine.
Say $X = \Spec(A)$, $S = \Spec(R)$ and $S' = \Spec(R')$. Our assumption
implies that $A$ and $R'$ are Tor independent over $R$
(More on Algebra, Lemma \ref{more-algebra-lemma-tor-independent}), i.e.,
$\text{Tor}_i^R(A, R') = 0$ for $i > 0$. In other words
$A \otimes_R^\mathbf{L} R' = A \otimes_R R'$ which exactly means
that $Lf^*g_*\mathcal{O}_{S'} = f^*g_*\mathcal{O}_{S'}$
(use Lemma \ref{lemma-quasi-coherence-pullback}).
\end{proof}

\noindent
The following lemma will be used in the chapter on dualizing complexes.

\begin{lemma}
\label{lemma-affine-morphism-and-hom-out-of-perfect}
Consider a cartesian square
$$
\xymatrix{
X' \ar[r]_{g'} \ar[d]_{f'} & X \ar[d]^f \\
S' \ar[r]^g & S
}
$$
of quasi-compact and quasi-separated schemes. Assume $g$ and $f$
Tor independent and $S = \Spec(R)$, $S' = \Spec(R')$ affine. For
$M, K \in D(\mathcal{O}_X)$ the canonical map
$$
R\Hom_X(M, K) \otimes^\mathbf{L}_R R'
\longrightarrow
R\Hom_{X'}(L(g')^*M, L(g')^*K)
$$
in $D(R')$ is an isomorphism in the following two cases
\begin{enumerate}
\item $M \in D(\mathcal{O}_X)$ is perfect and $K \in D_\QCoh(X)$, or
\item $M \in D(\mathcal{O}_X)$ is pseudo-coherent,
$K \in D_\QCoh^+(X)$, and $R'$ has finite tor dimension over $R$.
\end{enumerate}
\end{lemma}

\begin{proof}
There is a canonical map
$R\Hom_X(M, K) \to R\Hom_{X'}(L(g')^*M, L(g')^*K)$
in $D(\Gamma(X, \mathcal{O}_X))$ of global hom complexes, see
Cohomology, Section \ref{cohomology-section-global-RHom}.
Restricting scalars we can view this as a map in $D(R)$.
Then we can use the adjointness of restriction and
$- \otimes_R^\mathbf{L} R'$ to get the displayed map of the lemma.
Having defined the map it suffices to prove it is an isomorphism
in the derived category of abelian groups.

\medskip\noindent
The right hand side is equal to
$$
R\Hom_X(M, R(g')_*L(g')^*K) =
R\Hom_X(M, K \otimes_{\mathcal{O}_X}^\mathbf{L} g'_*\mathcal{O}_{X'})
$$
by Lemma \ref{lemma-affine-morphism-pull-push}. In both cases the complex
$R\SheafHom(M, K)$ is an object of $D_\QCoh(\mathcal{O}_X)$ by
Lemma \ref{lemma-quasi-coherence-internal-hom}. There is a natural map
$$
R\SheafHom(M, K) \otimes_{\mathcal{O}_X}^\mathbf{L} g'_*\mathcal{O}_{X'}
\longrightarrow
R\SheafHom(M, K \otimes_{\mathcal{O}_X}^\mathbf{L} g'_*\mathcal{O}_{X'})
$$
which is an isomorphism in both cases by
Lemma \ref{lemma-internal-hom-evaluate-tensor-isomorphism}.
To see that this lemma applies in case (2) we note that
$g'_*\mathcal{O}_{X'} = Rg'_*\mathcal{O}_{X'} =
Lf^*g_*\mathcal{O}_{S'}$ the second equality by
Lemma \ref{lemma-compare-base-change}.
Using Lemma \ref{lemma-tor-dimension-affine} and
Cohomology, Lemma \ref{cohomology-lemma-tor-amplitude-pullback}
we conclude that $g'_*\mathcal{O}_{X'}$ has finite Tor dimension.
Hence, in both cases by replacing $K$ by $R\SheafHom(M, K)$ we reduce
to proving
$$
R\Gamma(X, K) \otimes^\mathbf{L}_A A' \longrightarrow
R\Gamma(X, K \otimes^\mathbf{L}_{\mathcal{O}_X} g'_*\mathcal{O}_{X'})
$$
is an isomorphism.
Note that the left hand side is equal to $R\Gamma(X', L(g')^*K)$
by Lemma \ref{lemma-affine-morphism-pull-push}.
Hence the result follows from
Lemma \ref{lemma-compare-base-change}.
\end{proof}

\begin{remark}
\label{remark-multiplication-map}
With notation as in Lemma \ref{lemma-affine-morphism-and-hom-out-of-perfect}.
The diagram
$$
\xymatrix{
R\Hom_X(M, Rg'_*L) \otimes_R^\mathbf{L} R' \ar[r] \ar[d]_\mu &
R\Hom_{X'}(L(g')^*M, L(g')^*Rg'_*L) \ar[d]^a \\
R\Hom_X(M, R(g')_*L) \ar@{=}[r] &
R\Hom_{X'}(L(g')^*M, L)
}
$$
is commutative where the top horizontal arrow is the map from the lemma,
$\mu$ is the multiplication map, and $a$ comes from the adjunction map
$L(g')^*Rg'_*L \to L$. The multiplication map is the adjunction map
$K' \otimes_R^\mathbf{L} R' \to K'$ for any $K' \in D(R')$.
\end{remark}

\begin{lemma}
\label{lemma-tor-independence-and-tor-amplitude}
Consider a cartesian square of schemes
$$
\xymatrix{
X' \ar[r]_{g'} \ar[d]_{f'} & X \ar[d]^f \\
S' \ar[r]^g & S
}
$$
Assume $g$ and $f$ Tor independent.
\begin{enumerate}
\item If $E \in D(\mathcal{O}_X)$ has tor amplitude
in $[a, b]$ as a complex of $f^{-1}\mathcal{O}_S$-modules,
then $L(g')^*E$ has tor amplitude
in $[a, b]$ as a complex of $f^{-1}\mathcal{O}_{S'}$-modules.
\item If $\mathcal{G}$ is an $\mathcal{O}_X$-module flat
over $S$, then $L(g')^*\mathcal{G} = (g')^*\mathcal{G}$.
\end{enumerate}
\end{lemma}

\begin{proof}
We can compute tor dimension at stalks, see
Cohomology, Lemma \ref{cohomology-lemma-tor-amplitude-stalk}.
If $x' \in X'$ with image $x \in X$, then
$$
(L(g')^*E)_{x'} =
E_x \otimes_{\mathcal{O}_{X, x}}^\mathbf{L} \mathcal{O}_{X', x'}
$$
Let $s' \in S'$ and $s \in S$ be the image of $x'$ and $x$.
Since $X$ and $S'$ are tor independent over $S$, we can apply
More on Algebra, Lemma \ref{more-algebra-lemma-base-change-comparison}
to see that the right hand side of the displayed formula is equal to
$E_x \otimes_{\mathcal{O}_{S, s}}^\mathbf{L} \mathcal{O}_{S', s'}$
in $D(\mathcal{O}_{S', s'})$.
Thus (1) follows from
More on Algebra, Lemma \ref{more-algebra-lemma-pull-tor-amplitude}.
To see (2) observe that flatness of $\mathcal{G}$ is equivalent to
the condition that $\mathcal{G}[0]$ has tor amplitude in $[0, 0]$.
Applying (1) we conclude.
\end{proof}

\begin{lemma}
\label{lemma-compare-base-change-closed-immersion}
Consider a cartesian diagram of schemes
$$
\xymatrix{
Z' \ar[r]_{i'} \ar[d]_g & X' \ar[d]^f \\
Z \ar[r]^i & X
}
$$
where $i$ is a closed immersion. If $Z$ and $X'$ are
tor independent over $X$, then $Ri'_* \circ Lg^* = Lf^* \circ Ri_*$
as functors $D(\mathcal{O}_Z) \to D(\mathcal{O}_{X'})$.
\end{lemma}

\begin{proof}
Note that the lemma is supposed to hold for all $K \in D(\mathcal{O}_Z)$.
Observe that $i_*$ and $i'_*$ are exact functors and hence
$Ri_*$ and $Ri'_*$ are computed by applying $i_*$ and $i'_*$
to any representatives. Thus the base change map
$$
Lf^*(Ri_*(K)) \longrightarrow Ri'_*(Lg^*(K))
$$
on stalks at a point $z' \in Z'$ with image $z \in Z$ is given by
$$
K_z \otimes_{\mathcal{O}_{X, z}}^\mathbf{L} \mathcal{O}_{X', z'}
\longrightarrow
K_z \otimes_{\mathcal{O}_{Z, z}}^\mathbf{L} \mathcal{O}_{Z', z'}
$$
This map is an isomorphism by
More on Algebra, Lemma \ref{more-algebra-lemma-base-change-comparison}
and the assumed tor independence.
\end{proof}








\section{K\"unneth formula, II}
\label{section-kunneth}

\noindent
For the case where the base is a field, please see
Varieties, Section \ref{varieties-section-kunneth}.
Consider a cartesian diagram of schemes
$$
\xymatrix{
& X \times_S Y \ar[ld]^p \ar[rd]_q \ar[dd]^f \\
X \ar[rd]_a & & Y \ar[ld]^b \\
& S
}
$$
Let $K \in D(\mathcal{O}_X)$ and $M \in D(\mathcal{O}_Y)$.
There is a canonical map
\begin{equation}
\label{equation-kunneth}
Ra_*K \otimes_{\mathcal{O}_S}^\mathbf{L} Rb_*M
\longrightarrow
Rf_*(Lp^*K \otimes_{\mathcal{O}_{X \times_S Y}}^\mathbf{L} Lq^*M)
\end{equation}
Namely, we can use the maps
$Ra_*K \to Ra_*Rp_* Lp^*K = Rf_*Lp^*K$ and
$Rb_*M \to Rb_*Rq_* Lq^*M = Rf_*Lq^*M$ and then we can use the
relative cup product (Cohomology, Remark \ref{cohomology-remark-cup-product}).

\medskip\noindent
Set $A = \Gamma(S, \mathcal{O}_S)$. There is a global K\"unneth map
\begin{equation}
\label{equation-kunneth-global}
R\Gamma(X, K) \otimes_A^\mathbf{L} R\Gamma(Y, M)
\longrightarrow
R\Gamma(X \times_S Y,
Lp^*K \otimes_{\mathcal{O}_{X \times_S Y}}^\mathbf{L} Lq^*M)
\end{equation}
in $D(A)$. This map is constructed using the pullback maps
$R\Gamma(X, K) \to R\Gamma(X \times_S Y, Lp^*K)$ and
$R\Gamma(Y, M) \to R\Gamma(X \times_S Y, Lq^*M)$ and
the cup product constructed in
Cohomology, Section \ref{cohomology-section-cup-product}.

\begin{lemma}
\label{lemma-kunneth}
In the situation above, if $a$ and $b$ are quasi-compact and quasi-separated
and $X$ and $Y$ are tor-independent over $S$, then (\ref{equation-kunneth})
is an isomorphism for $K \in D_\QCoh(\mathcal{O}_X)$ and
$M \in D_\QCoh(\mathcal{O}_Y)$. If in addition $S = \Spec(A)$ is affine,
then the map (\ref{equation-kunneth-global}) is an isomorphism.
\end{lemma}

\begin{proof}[First proof]
This follows from the following sequence of isomorphisms
\begin{align*}
Rf_*(Lp^*K \otimes_{\mathcal{O}_{X \times_S Y}}^\mathbf{L} Lq^*M)
& =
Ra_*Rp_*(Lp^*K \otimes_{\mathcal{O}_{X \times_S Y}}^\mathbf{L} Lq^*M) \\
& =
Ra_*(K \otimes_{\mathcal{O}_X}^\mathbf{L} Rp_*Lq^*M) \\
& =
Ra_*(K \otimes_{\mathcal{O}_X}^\mathbf{L} La^*Rb_*M) \\
& =
Ra_*K \otimes_{\mathcal{O}_S}^\mathbf{L} Rb_*M
\end{align*}
The first equality holds because $f = a \circ p$. The second equality
by Lemma \ref{lemma-cohomology-base-change}. The third equality by
Lemma \ref{lemma-compare-base-change}.  The fourth equality by
Lemma \ref{lemma-cohomology-base-change}.
We omit the verification that the composition of these isomorphisms
is the same as the map (\ref{equation-kunneth}).
If $S$ is affine, then the source and target of the arrow
(\ref{equation-kunneth-global}) are the result of applying
$R\Gamma(S, -)$ to the source and target of (\ref{equation-kunneth})
and we obtain the final statement; details omitted.
\end{proof}

\begin{proof}[Second proof]
The construction of the arrow (\ref{equation-kunneth}) is compatible
with restricting to open subschemes of $S$ as is immediate from the
construction of the relative cup product. Thus it suffices to prove
that (\ref{equation-kunneth}) is an isomorphism when $S$ is affine.

\medskip\noindent
Assume $S = \Spec(A)$ is affine. By Leray we have
$R\Gamma(S, Rf_*K) = R\Gamma(X, K)$ and similarly for the
other cases. By Cohomology, Lemma \ref{cohomology-lemma-compose-cup-product}
the map (\ref{equation-kunneth}) induces the map
(\ref{equation-kunneth-global}) on taking $R\Gamma(S, -)$.
On the other hand, by
Lemmas \ref{lemma-quasi-coherence-direct-image} and
\ref{lemma-quasi-coherence-tensor-product}
the source and target of the map
(\ref{equation-kunneth}) are in $D_\QCoh(\mathcal{O}_S)$.
Thus, by Lemma \ref{lemma-affine-compare-bounded}, it suffices to prove that
(\ref{equation-kunneth-global}) is an isomorphism.

\medskip\noindent
Assume $S = \Spec(A)$ and $X = \Spec(B)$ and $Y = \Spec(C)$ are all affine.
We will use Lemma \ref{lemma-affine-compare-bounded} without further mention.
In this case we can choose a K-flat complex $K^\bullet$ of $B$-modules
whose terms are flat such that $K$ is represented by $\widetilde{K}^\bullet$.
Similarly, we can choose a K-flat complex $M^\bullet$ of $C$-modules
whose terms are flat such that $M$ is represented by $\widetilde{M}^\bullet$.
See More on Algebra, Lemma \ref{more-algebra-lemma-K-flat-resolution}.
Then $\widetilde{K}^\bullet$ is a K-flat complex of $\mathcal{O}_X$-modules
and similarly for $\widetilde{M}^\bullet$, see
Lemma \ref{lemma-affine-K-flat}. Thus
$La^*K$ is represented by
$$
a^*\widetilde{K}^\bullet = \widetilde{K^\bullet \otimes_A C}
$$
and similarly for $Lb^*M$. This in turn is a K-flat complex
of $\mathcal{O}_{X \times_S Y}$-modules by the lemma cited above
and More on Algebra, Lemma \ref{more-algebra-lemma-base-change-K-flat}.
Thus we finally see that the complex of
$\mathcal{O}_{X \times_S Y}$-modules associated to
$$
\text{Tot}((K^\bullet \otimes_A C) \otimes_{B \otimes_A C}
(B \otimes_A M^\bullet)) =
\text{Tot}(K^\bullet \otimes_A M^\bullet)
$$
represents $La^*K \otimes_{\mathcal{O}_{X \times_S Y}}^\mathbf{L} Lb^*M$
in the derived category of $X \times_S Y$. Taking global sections
we obtain $\text{Tot}(K^\bullet \otimes_A M^\bullet)$ which of course
is also the complex representing
$R\Gamma(X, K) \otimes_A^\mathbf{L} R\Gamma(Y, M)$.
The fact that the isomorphism is given by cup product follows from the
relationship between the genuine cup product and the naive one
in Cohomology, Section \ref{cohomology-section-cup-product}
(and in particular
Cohomology, Lemma \ref{cohomology-lemma-cup-compatible-with-naive}
and the discussion following it).

\medskip\noindent
Assume $S = \Spec(A)$ and $Y$ are affine. We will use the induction
principle of
Cohomology of Schemes, Lemma \ref{coherent-lemma-induction-principle}
to prove the statement. To do this we only have to show:
if $X = U \cup V$ is an open covering with $U$ and $V$ quasi-compact
and if the map (\ref{equation-kunneth-global})
$$
R\Gamma(U, K) \otimes_A^\mathbf{L} R\Gamma(Y, M)
\longrightarrow
R\Gamma(U \times_S Y,
Lp^*K \otimes_{\mathcal{O}_{X \times_S Y}}^\mathbf{L} Lq^*M)
$$
for $U$ and $Y$ over $S$, the map (\ref{equation-kunneth-global})
$$
R\Gamma(V, K) \otimes_A^\mathbf{L} R\Gamma(Y, M)
\longrightarrow
R\Gamma(V \times_S Y,
Lp^*K \otimes_{\mathcal{O}_{X \times_S Y}}^\mathbf{L} Lq^*M)
$$
for $V$ and $Y$ over $S$, and the map (\ref{equation-kunneth-global})
$$
R\Gamma(U \cap V, K) \otimes_A^\mathbf{L} R\Gamma(Y, M)
\longrightarrow
R\Gamma((U \cap V) \times_S Y,
Lp^*K \otimes_{\mathcal{O}_{X \times_S Y}}^\mathbf{L} Lq^*M)
$$
for $U \cap V$ and $Y$ over $S$ are isomorphisms, then so is the map
(\ref{equation-kunneth-global}) for $X$ and $Y$ over $S$.
However, by Cohomology, Lemma \ref{cohomology-lemma-mayer-vietoris-cup}
these maps fit into a map of distinguished triangles with
(\ref{equation-kunneth-global}) the final leg and hence we conclude
by Derived Categories, Lemma \ref{derived-lemma-third-isomorphism-triangle}.

\medskip\noindent
Assume $S = \Spec(A)$ is affine. To finish the proof we can use the
induction principle of
Cohomology of Schemes, Lemma \ref{coherent-lemma-induction-principle}
on $Y$. Namely, by the above we already know that our map is
an isomorphism when $Y$ is affine. The rest of the argument is
exactly the same as in the previous paragraph but with the roles of
$X$ and $Y$ switched.
\end{proof}

\begin{lemma}
\label{lemma-cohomology-de-rham-base-change}
Let $a : X \to S$ be a quasi-compact and quasi-separated morphism
of schemes. Let $\mathcal{F}^\bullet$ be a locally bounded
complex of $a^{-1}\mathcal{O}_S$-modules. Assume for all $n \in \mathbf{Z}$
the sheaf $\mathcal{F}^n$ is a flat $a^{-1}\mathcal{O}_S$-module and
$\mathcal{F}^n$ has the structure of a quasi-coherent $\mathcal{O}_X$-module
compatible with the given $a^{-1}\mathcal{O}_S$-module structure (but the
differentials in the complex $\mathcal{F}^\bullet$ need not
be $\mathcal{O}_X$-linear). Then the following hold
\begin{enumerate}
\item $Ra_*\mathcal{F}^\bullet$ is locally bounded,
\item $Ra_*\mathcal{F}^\bullet$ is in $D_\QCoh(\mathcal{O}_S)$,
\item $Ra_*\mathcal{F}^\bullet$ locally has finite tor dimension,
\item $\mathcal{G} \otimes_{\mathcal{O}_S}^\mathbf{L} Ra_*\mathcal{F}^\bullet =
Ra_*(a^{-1}\mathcal{G} \otimes_{a^{-1}\mathcal{O}_S} \mathcal{F}^\bullet)$
for $\mathcal{G} \in \QCoh(\mathcal{O}_S)$, and
\item $K \otimes_{\mathcal{O}_S}^\mathbf{L} Ra_*\mathcal{F}^\bullet =
Ra_*(a^{-1}K \otimes_{a^{-1}\mathcal{O}_S}^\mathbf{L} \mathcal{F}^\bullet)$
for $K \in D_\QCoh(\mathcal{O}_S)$.
\end{enumerate}
\end{lemma}

\begin{proof}
Parts (1), (2), (3) are local on $S$ hence we may and do assume $S$
is affine. Since $a$ is quasi-compact we conclude that $X$ is quasi-compact.
Since $\mathcal{F}^\bullet$ is locally bounded, we conclude that
$\mathcal{F}^\bullet$ is bounded.

\medskip\noindent
For (1) and (2) we can use the first spectral sequence
$R^pa_*\mathcal{F}^q \Rightarrow R^{p + q}a_*\mathcal{F}^\bullet$ of
Derived Categories, Lemma \ref{derived-lemma-two-ss-complex-functor}.
Combining Cohomology of Schemes, Lemma
\ref{coherent-lemma-quasi-coherence-higher-direct-images}
and Homology, Lemma \ref{homology-lemma-biregular-ss-converges}
we conclude.

\medskip\noindent
Let us prove (3) by the induction principle of
Cohomology of Schemes, Lemma \ref{coherent-lemma-induction-principle}.
Namely, for a quasi-compact open of $U$ of $X$ consider the
condition that $R(a|_U)_*(\mathcal{F}^\bullet|_U)$ has
finite tor dimension. If $U, V$ are quasi-compact open in
$X$, then we have a relative Mayer-Vietoris distinguished triangle
$$
R(a|_{U \cup V})_*\mathcal{F}^\bullet|_{U \cup V} \to
R(a|_U)_*\mathcal{F}^\bullet|_U \oplus
R(a|_V)_*\mathcal{F}^\bullet|_V \to
R(a|_{U \cap V})_*\mathcal{F}^\bullet|_{U \cap V} \to
$$
by Cohomology, Lemma \ref{cohomology-lemma-unbounded-relative-mayer-vietoris}.
By the behaviour of tor amplitude in distinguished triangles
(see Cohomology, Lemma \ref{cohomology-lemma-cone-tor-amplitude})
we see that if we know the result for $U$, $V$, $U \cap V$, then
the result holds for $U \cup V$. This reduces us to the case where
$X$ is affine. In this case we have
$$
Ra_*\mathcal{F}^\bullet = a_*\mathcal{F}^\bullet
$$
by Leray's acyclicity lemma
(Derived Categories, Lemma \ref{derived-lemma-leray-acyclicity})
and the vanishing of higher direct images of quasi-coherent modules
under an affine morphism
(Cohomology of Schemes, Lemma \ref{coherent-lemma-relative-affine-vanishing}).
Since $\mathcal{F}^n$ is $S$-flat by assumption and $X$ affine, the modules
$a_*\mathcal{F}^n$ are flat for all $n$. Hence $a_*\mathcal{F}^\bullet$
is a bounded complex of flat $\mathcal{O}_S$-modules and hence has
finite tor dimension.

\medskip\noindent
Proof of part (5). Denote
$a' : (X, a^{-1}\mathcal{O}_S) \to (S, \mathcal{O}_S)$
the obvious flat morphism of ringed spaces. Part (5) says that
$$
K \otimes_{\mathcal{O}_S}^\mathbf{L} Ra'_*\mathcal{F}^\bullet =
Ra'_*(L(a')^*K \otimes_{a^{-1}\mathcal{O}_S}^\mathbf{L}
\mathcal{F}^\bullet)
$$
Thus
Cohomology, Equation (\ref{cohomology-equation-projection-formula-map})
gives a functorial map from the left to the right and we want to show
this map is an isomorphism.
This question is local on $S$ hence we may and do assume $S$
is affine. The rest of the proof is {\it exactly} the same as the
proof of Lemma \ref{lemma-cohomology-base-change} except that we have
to show that the functor
$K \mapsto Ra'_*(L(a')^*K \otimes_{a^{-1}\mathcal{O}_S}^\mathbf{L}
\mathcal{F}^\bullet)$ commutes with direct sums.
This is where we will use $\mathcal{F}^n$ has the structure
of a quasi-coherent $\mathcal{O}_X$-module. Namely, observe that
$K \mapsto L(a')^*K
\otimes_{a^{-1}\mathcal{O}_S}^\mathbf{L} \mathcal{F}^\bullet$
commutes with arbitrary direct sums. Next, if
$\mathcal{F}^\bullet$ consists of a single quasi-coherent
$\mathcal{O}_X$-module $\mathcal{F}^\bullet = \mathcal{F}^n[-n]$
then we have $L(a')^*G
\otimes_{a^{-1}\mathcal{O}_S}^\mathbf{L} \mathcal{F}^\bullet =
La^*K \otimes_{\mathcal{O}_X}^\mathbf{L} \mathcal{F}^n[-n]$, see
Cohomology, Lemma \ref{cohomology-lemma-variant-derived-pullback}.
Hence in this case the commutation with direct sums follows from
Lemma \ref{lemma-quasi-coherence-pushforward-direct-sums}.
Now, in general, since $S$ is affine (hence $X$ quasi-compact)
and $\mathcal{F}^\bullet$ is locally bounded, we see that
$$
\mathcal{F}^\bullet = (\mathcal{F}^a \to \ldots \to \mathcal{F}^b)
$$
is bounded. Arguing by induction on $b - a$ and considering the
distinguished triangle
$$
\mathcal{F}^b[-b] \to (\mathcal{F}^a \to \ldots \to \mathcal{F}^b)
\to (\mathcal{F}^a \to \ldots \to \mathcal{F}^{b - 1}) \to
\mathcal{F}^b[-b + 1]
$$
the proof of this part is finished. Some details omitted.

\medskip\noindent
Proof of part (4). Let $a' : (X, a^{-1}\mathcal{O}_S) \to (S, \mathcal{O}_S)$
be as above. Since $\mathcal{F}^\bullet$ is a locally bounded
complex of flat $a^{-1}\mathcal{O}_S$-modules we see the complex
$a^{-1}\mathcal{G} \otimes_{a^{-1}\mathcal{O}_S} \mathcal{F}^\bullet$
represents $L(a')^*\mathcal{G}
\otimes_{a^{-1}\mathcal{O}_S}^\mathbf{L}
\mathcal{F}^\bullet$ in $D(a^{-1}\mathcal{O}_S)$. Hence (4)
follows from (5).
\end{proof}

\begin{lemma}
\label{lemma-K-flat}
Let $f : X \to Y$ be a morphism of schemes with $Y = \Spec(A)$ affine.
Let $\mathcal{U} : X = \bigcup_{i \in I} U_i$ be a finite affine open covering
such that all the finite intersections
$U_{i_0 \ldots i_p} = U_{i_0} \cap \ldots \cap U_{i_p}$
are affine. Let $\mathcal{F}^\bullet$ be a bounded complex of
$f^{-1}\mathcal{O}_Y$-modules. Assume for all $n \in \mathbf{Z}$
the sheaf $\mathcal{F}^n$ is a flat $f^{-1}\mathcal{O}_Y$-module and
$\mathcal{F}^n$ has the structure of a quasi-coherent $\mathcal{O}_X$-module
compatible with the given $p^{-1}\mathcal{O}_Y$-module structure (but the
differentials in the complex $\mathcal{F}^\bullet$ need not
be $\mathcal{O}_X$-linear). Then the complex
$\text{Tot}(\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F}^\bullet))$
is K-flat as a complex of $A$-modules.
\end{lemma}

\begin{proof}
We may write
$$
\mathcal{F}^\bullet = (\mathcal{F}^a \to \ldots \to \mathcal{F}^b)
$$
Arguing by induction on $b - a$ and considering the distinguished triangle
$$
\mathcal{F}^b[-b] \to (\mathcal{F}^a \to \ldots \to \mathcal{F}^b)
\to (\mathcal{F}^a \to \ldots \to \mathcal{F}^{b - 1}) \to
\mathcal{F}^b[-b + 1]
$$
and using
More on Algebra, Lemma \ref{more-algebra-lemma-K-flat-two-out-of-three}
we reduce to the case where $\mathcal{F}^\bullet$ consists of a
single quasi-coherent $\mathcal{O}_X$-module $\mathcal{F}$
placed in degree $0$. In this case the {\v C}ech complex
for $\mathcal{F}$ and $\mathcal{U}$ is homotopy equivalent to the
alternating {\v C}ech complex, see
Cohomology, Lemma \ref{cohomology-lemma-alternating-usual}.
Since $U_{i_0 \ldots i_p}$ is always affine, we see that
$\mathcal{F}(U_{i_0 \ldots i_p})$ is $A$-flat.
Hence
$\check{\mathcal{C}}_{alt}^\bullet(\mathcal{U}, \mathcal{F})$
is a bounded complex of flat $A$-modules and hence K-flat
by More on Algebra, Lemma
\ref{more-algebra-lemma-derived-tor-quasi-isomorphism}.
\end{proof}

\noindent
Let $X, Y, S, a, b, p, q, f$ be as in the introduction to this section.
Let $\mathcal{F}$ be an $\mathcal{O}_X$-module.
Let $\mathcal{G}$ be an $\mathcal{O}_Y$-module.
Set $A = \Gamma(S, \mathcal{O}_S)$.
Consider the map
\begin{equation}
\label{equation-kunneth-single-sheaves}
R\Gamma(X, \mathcal{F})
\otimes_A^\mathbf{L}
R\Gamma(Y, \mathcal{G})
\longrightarrow
R\Gamma(X \times_S Y,
p^*\mathcal{F}
\otimes_{\mathcal{O}_{X \times_S Y}}
q^*\mathcal{G})
\end{equation}
in $D(A)$. This map is constructed using the pullback maps
$R\Gamma(X, \mathcal{F}) \to R\Gamma(X \times_S Y, p^*\mathcal{F})$ and
$R\Gamma(Y, \mathcal{G}) \to R\Gamma(X \times_S Y, q^*\mathcal{G})$,
the cup product constructed in
Cohomology, Section \ref{cohomology-section-cup-product}, and
the canonical map
$p^*\mathcal{F}
\otimes_{\mathcal{O}_{X \times_S Y}}^\mathbf{L}
q^*\mathcal{G}
\to
p^*\mathcal{F}
\otimes_{\mathcal{O}_{X \times_S Y}}
q^*\mathcal{G}$.

\begin{lemma}
\label{lemma-kunneth-single-sheaf}
In the situation above the map (\ref{equation-kunneth-single-sheaves}) is an
isomorphism if $S$ is affine, $\mathcal{F}$ and $\mathcal{G}$ are $S$-flat and
quasi-coherent and $X$ and $Y$ are quasi-compact with affine diagonal.
\end{lemma}

\begin{proof}
We strongly urge the reader to read the proof of
Varieties, Lemma \ref{varieties-lemma-kunneth} first.
Choose finite affine open coverings
$\mathcal{U} : X = \bigcup_{i \in I} U_i$ and
$\mathcal{V} : Y = \bigcup_{j \in J} V_j$.
This determines an affine open covering
$\mathcal{W} : X \times_S Y = \bigcup_{(i, j) \in I \times J} U_i \times_S V_j$.
Note that $\mathcal{W}$ is a refinement of
$\text{pr}_1^{-1}\mathcal{U}$ and of $\text{pr}_2^{-1}\mathcal{V}$.
Thus by the discussion in Cohomology, Section
\ref{cohomology-section-cech-cohomology-of-complexes}
we obtain maps
$$
\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F})
\to
\check{\mathcal{C}}^\bullet(\mathcal{W}, p^*\mathcal{F})
\quad\text{and}\quad
\check{\mathcal{C}}^\bullet(\mathcal{V}, \mathcal{G})
\to
\check{\mathcal{C}}^\bullet(\mathcal{W}, q^*\mathcal{G})
$$
well defined up to homotopy and compatible with pullback maps on cohomology.
In Cohomology, Equation (\ref{cohomology-equation-needs-signs})
we have constructed a map of complexes
$$
\text{Tot}(
\check{\mathcal{C}}^\bullet(\mathcal{W}, p^*\mathcal{F})
\otimes_A
\check{\mathcal{C}}^\bullet(\mathcal{W}, q^*\mathcal{G}))
\longrightarrow
\check{\mathcal{C}}^\bullet(\mathcal{W},
p^*\mathcal{F} \otimes_{\mathcal{O}_{X \times_S Y}}
q^*\mathcal{G})
$$
which is compatible with the cup product on cohomology by
Cohomology, Lemma \ref{cohomology-lemma-diagrams-commute}.
Combining the above we obtain a map of complexes
\begin{equation}
\label{equation-kunneth-on-cech}
\text{Tot}(
\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F})
\otimes_A
\check{\mathcal{C}}^\bullet(\mathcal{V}, \mathcal{G}))
\to
\check{\mathcal{C}}^\bullet(\mathcal{W},
p^*\mathcal{F}
\otimes_{\mathcal{O}_{X \times_S Y}}
q^*\mathcal{G})
\end{equation}
We claim this is the map in the statement of the lemma, i.e.,
the source and target of this arrow are the same as the source
and target of (\ref{equation-kunneth-single-sheaves}). Namely, by
Cohomology of Schemes, Lemma
\ref{coherent-lemma-quasi-coherent-affine-cohomology-zero}
and
Cohomology, Lemma \ref{cohomology-lemma-cech-complex-complex-computes}
the canonical maps
$$
\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F})
\to
R\Gamma(X, \mathcal{F}),
\quad
\check{\mathcal{C}}^\bullet(\mathcal{V}, \mathcal{G})
\to
R\Gamma(Y, \mathcal{G})
$$
and
$$
\check{\mathcal{C}}^\bullet(\mathcal{W},
p^*\mathcal{F} \otimes_{\mathcal{O}_{X \times_S Y}} q^*\mathcal{G})
\to
R\Gamma(X \times_S Y,
p^*\mathcal{F} \otimes_{\mathcal{O}_{X \times_S Y}}
q^*\mathcal{G})
$$
are isomorphisms. On the other hand, the complex
$\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F})$
is K-flat by Lemma \ref{lemma-K-flat} and we conclude that
$\text{Tot}(
\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F})
\otimes_A
\check{\mathcal{C}}^\bullet(\mathcal{V}, \mathcal{G}))$
represents the derived tensor product
$R\Gamma(X, \mathcal{F}) \otimes_A^\mathbf{L} R\Gamma(Y, \mathcal{G})$
as claimed.

\medskip\noindent
We still have to show that (\ref{equation-kunneth-on-cech})
is a quasi-isomorphism. We will do this using dimension shifting.
Set $d(\mathcal{F}) = \max \{d \mid H^d(X, \mathcal{F}) \not = 0\}$.
Assume $d(\mathcal{F}) > 0$. Set $U = \coprod\nolimits_{i \in I} U_i$.
This is an affine scheme as $I$ is finite. Denote
$j : U \to X$ the morphism which is the inclusion $U_i \to X$
on each $U_i$. Since the diagonal of $X$ is affine, the morphism
$j$ is affine, see
Morphisms, Lemma \ref{morphisms-lemma-affine-permanence}.
It follows that $\mathcal{F}' = j_*j^*\mathcal{F}$ is $S$-flat, see
Morphisms, Lemma \ref{morphisms-lemma-pushforward-flat-affine}.
It also follows that $d(\mathcal{F}') = 0$ by combining
Cohomology of Schemes, Lemmas
\ref{coherent-lemma-relative-affine-cohomology} and
\ref{coherent-lemma-quasi-coherent-affine-cohomology-zero}.
For all $x \in X$ we have $\mathcal{F}_x  \to \mathcal{F}'_x$
is the inclusion of a direct summand: if $x \in U_i$,
then $\mathcal{F}' \to (U_i \to X)_*\mathcal{F}|_{U_i}$
gives a splitting. We conclude that
$\mathcal{F} \to \mathcal{F}'$ is injective and
$\mathcal{F}'' = \mathcal{F}'/\mathcal{F}$
is $S$-flat as well. The short exact sequence
$0 \to \mathcal{F} \to \mathcal{F}' \to \mathcal{F}'' \to 0$
of flat quasi-coherent $\mathcal{O}_X$-modules
produces a short exact sequence of complexes
$$
0 \to
\text{Tot}(
\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F})
\otimes_A
\check{\mathcal{C}}^\bullet(\mathcal{V}, \mathcal{G})) \to
\text{Tot}(
\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F}')
\otimes_A
\check{\mathcal{C}}^\bullet(\mathcal{V}, \mathcal{G})) \to
\text{Tot}(
\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F}'')
\otimes_A
\check{\mathcal{C}}^\bullet(\mathcal{V}, \mathcal{G})) \to 0
$$
and a short exact sequence of complexes
$$
0 \to
\check{\mathcal{C}}^\bullet(\mathcal{W},
p^*\mathcal{F}
\otimes_{\mathcal{O}_{X \times_S Y}}
q^*\mathcal{G}) \to
\check{\mathcal{C}}^\bullet(\mathcal{W},
p^*\mathcal{F}'
\otimes_{\mathcal{O}_{X \times_S Y}}
q^*\mathcal{G}) \to
\check{\mathcal{C}}^\bullet(\mathcal{W},
p^*\mathcal{F}''
\otimes_{\mathcal{O}_{X \times_S Y}}
q^*\mathcal{G}) \to 0
$$
Moreover, the maps (\ref{equation-kunneth-on-cech}) between these are
compatible with these short exact sequences. Hence it suffices to prove
(\ref{equation-kunneth-on-cech})
is an isomorphism for $\mathcal{F}'$ and $\mathcal{F}''$. Finally,
we have $d(\mathcal{F}'') < d(\mathcal{F})$.
In this way we reduce to the case $d(\mathcal{F}) = 0$.

\medskip\noindent
Arguing in the same fashion for $\mathcal{G}$ we find that we
may assume that both $\mathcal{F}$ and $\mathcal{G}$
have nonzero cohomology only in degree $0$.
Observe that this means that $\Gamma(X, \mathcal{F})$
is quasi-isomorphic to the $K$-flat complex
$\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F})$
of $A$-modules sitting in degrees $\geq 0$.
It follows that $\Gamma(X, \mathcal{F})$ is a flat $A$-module
(because we can compute higher Tor's against this module
by tensoring with the Cech complex).
Let $V \subset Y$ be an affine open. Consider the affine open covering
$\mathcal{U}_V : X \times_S V = \bigcup_{i \in I} U_i \times_S V$.
It is immediate that
$$
\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F})
\otimes_A \mathcal{G}(V) =
\check{\mathcal{C}}^\bullet(\mathcal{U}_V,
p^*\mathcal{F} \otimes_{\mathcal{O}_{X \times Y}}
q^*\mathcal{G})
$$
(equality of complexes). By the flatness of $\mathcal{G}(V)$
over $A$ we see that
$\Gamma(X, \mathcal{F}) \otimes_A \mathcal{G}(V) \to
\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F})
\otimes_A \mathcal{G}(V)$ is a quasi-isomorphism.
Since the sheafification of
$V \mapsto \check{\mathcal{C}}^\bullet(\mathcal{U}_V,
p^*\mathcal{F} \otimes_{\mathcal{O}_{X \times Y}}
q^*\mathcal{G})$ represents
$Rq_*(p^*\mathcal{F} \otimes_{\mathcal{O}_{X \times Y}} q^*\mathcal{G})$
by Cohomology of Schemes, Lemma
\ref{coherent-lemma-separated-case-relative-cech}
we conclude that
$$
Rq_*(p^*\mathcal{F} \otimes_{\mathcal{O}_{X \times Y}} q^*\mathcal{G})
\cong
\Gamma(X, \mathcal{F}) \otimes_A \mathcal{G}
$$
on $Y$ where the notation on the right hand side indicates the module
$$
b^*\widetilde{\Gamma(X, \mathcal{F})} \otimes_{\mathcal{O}_Y} \mathcal{G}
$$
Using the Leray spectral sequence for $q$ we find
$$
H^n(X \times_S Y, p^*\mathcal{F} \otimes_{\mathcal{O}_{X \times Y}}
q^*\mathcal{G}) =
H^n(Y,
b^*\widetilde{\Gamma(X, \mathcal{F})} \otimes_{\mathcal{O}_Y} \mathcal{G})
$$
Using Lemma \ref{lemma-cohomology-base-change} for the morphism
$b : Y \to S = \Spec(A)$ and using that $\Gamma(X, \mathcal{F})$
is $A$-flat we conclude that
$H^n(X \times_S Y, p^*\mathcal{F} \otimes_{\mathcal{O}_{X \times Y}}
q^*\mathcal{G})$ is zero for $n > 0$ and isomorphic to
$H^0(X, \mathcal{F}) \otimes_A H^0(Y, \mathcal{G})$ for $n = 0$.
Of course, here we also use that $\mathcal{G}$ only has
cohomology in degree $0$.
This finishes the proof (except that we should check that the
isomorphism is indeed given by cup product in degree $0$; we omit
the verification).
\end{proof}

\begin{remark}
\label{remark-annoying-compatibility}
Let $S = \Spec(A)$ be an affine scheme. Let $a : X \to S$
and $b : Y \to S$ be morphisms of schemes. Let $\mathcal{F}$, $\mathcal{G}$
be quasi-coherent $\mathcal{O}_X$-modules and let $\mathcal{E}$
be a quasi-coherent $\mathcal{O}_Y$-module. Let
$\xi \in H^i(X, \mathcal{G})$ with pullback
$p^*\xi \in H^i(X \times_S Y, p^*\mathcal{G})$.
Then the following diagram is commutative
$$
\xymatrix{
R\Gamma(X, \mathcal{F})[-i] \otimes_A^\mathbf{L} R\Gamma(Y, \mathcal{E})
\ar[d] \ar[rr]_-{\xi \otimes \text{id}} & &
R\Gamma(X, \mathcal{G} \otimes_{\mathcal{O}_X} \mathcal{F})
\otimes_A^\mathbf{L} R\Gamma(Y, \mathcal{E}) \ar[d] \\
R\Gamma(X \times_S Y, p^*\mathcal{F} \otimes q^*\mathcal{E})[-i]
\ar[rr]^-{p^*\xi} & &
R\Gamma(X \times_S Y,
p^*(\mathcal{G} \otimes_{\mathcal{O}_X} \mathcal{F}) \otimes q^*\mathcal{E})
}
$$
where the unadorned tensor products are over $\mathcal{O}_{X \times_S Y}$.
The horizontal arrows are from Cohomology, Remark
\ref{cohomology-remark-cup-with-element-map-total-cohomology}
and the vertical arrows are (\ref{equation-kunneth-global})
hence given by pulling back followed by cup product on $X \times_S Y$.
The diagram commutes because the global cup product (on $X \times_S Y$
with the sheaves $p^*\mathcal{G}$, $p^*\mathcal{F}$, and $q^*\mathcal{E}$)
is associative, see
Cohomology, Lemma \ref{cohomology-lemma-cup-product-associative}.
\end{remark}







\section{K\"unneth formula, III}
\label{section-kunneth-complexes}

\noindent
Let $X, Y, S, a, b, p, q, f$ be as in the introduction to
Section \ref{section-kunneth}. In this section, given an
$\mathcal{O}_X$-module $\mathcal{F}$ and a $\mathcal{O}_Y$-module
$\mathcal{G}$ let us set
$$
\mathcal{F} \boxtimes \mathcal{G} =
p^*\mathcal{F} \otimes_{\mathcal{O}_{X \times_S Y}} q^*\mathcal{G}
$$
Note that, contrary to what happens in a future section, we take
the nonderived tensor product here.

\medskip\noindent
On $X$ let $\mathcal{F}^\bullet$ be a complex of sheaves of abelian groups
whose terms are quasi-coherent $\mathcal{O}_X$-modules
such that the differentials
$d^i_\mathcal{F} : \mathcal{F}^i \to \mathcal{F}^{i + 1}$
are differential operators on $X/S$ of finite order, see
Morphisms, Section \ref{morphisms-section-differential-operators}.
Similarly, on $Y$ let $\mathcal{G}^\bullet$ be a complex of sheaves
of abelian groups whose terms are quasi-coherent $\mathcal{O}_Y$-modules
such that the differentials
$d^j_\mathcal{G} : \mathcal{G}^j \to \mathcal{G}^{j + 1}$
are differential operators on $Y/S$ of finite order.
Applying the construction of
Morphisms, Lemma \ref{morphisms-lemma-base-change-differential-operators}
we obtain a double complex
$$
\xymatrix{
\ldots &
\ldots &
\ldots &
\ldots \\
\ldots \ar[r] &
\mathcal{F}^i \boxtimes \mathcal{G}^{j + 1}
\ar[r]^{d_1^{i, j + 1}} \ar[u] &
\mathcal{F}^{i + 1} \boxtimes \mathcal{G}^{j + 1} \ar[r] \ar[u] &
\ldots \\
\ldots \ar[r] &
\mathcal{F}^i \boxtimes \mathcal{G}^j
\ar[r]^{d_1^{i, j}} \ar[u]^{d_2^{i, j}} &
\mathcal{F}^{i + 1} \boxtimes \mathcal{G}^j \ar[r] \ar[u]_{d_2^{i + 1, j}} &
\ldots \\
\ldots &
\ldots \ar[u] &
\ldots \ar[u] &
\ldots
}
$$
of quasi-coherent modules whose maps are differential operators of
finite order on $X \times_S Y / S$. Please see the discussion in
Morphisms, Remark \ref{morphisms-remark-base-change-differential-operators}
and
Homology, Example \ref{homology-example-double-complex-as-tensor-product-of}.
To be explicit, we set
$$
d_1^{i, j} = d^i_\mathcal{F} \boxtimes 1
\quad\text{and}\quad
d_2^{i, j} = 1 \boxtimes d^j_\mathcal{G}
$$
In the discussion below the notation
$$
\text{Tot}(\mathcal{F}^\bullet \boxtimes \mathcal{G}^\bullet)
$$
refers to the total complex associated to this double complex.
This complex has terms which are quasi-coherent
$\mathcal{O}_{X \times_S Y}$-modules and whose differentials
are differential operators of finite order on $X \times_S Y / S$.

\medskip\noindent
In the situation above there exists a ``relative cup product'' map
\begin{equation}
\label{equation-relative-de-rham-kunneth}
Ra_*(\mathcal{F}^\bullet)
\otimes_{\mathcal{O}_S}^\mathbf{L}
Rb_*(\mathcal{G}^\bullet)
\longrightarrow
Rf_*\left(\text{Tot}(\mathcal{F}^\bullet \boxtimes \mathcal{G}^\bullet)\right)
\end{equation}
Namely, we can construct this map by combining
\begin{enumerate}
\item $Ra_*(\mathcal{F}^\bullet) \to Rf_*(p^{-1}\mathcal{F}^\bullet)$,
\item $Rb_*(\mathcal{G}^\bullet) \to Rf_*(q^{-1}\mathcal{G}^\bullet)$,
\item
$Rf_*(p^{-1}\mathcal{F}^\bullet)
\otimes_{\mathcal{O}_S}^\mathbf{L}
Rf_*(q^{-1}\mathcal{G}^\bullet)
\to
Rf_*(p^{-1}\mathcal{F}^\bullet \otimes_{f^{-1}\mathcal{O}_S}^\mathbf{L}
q^{-1}\mathcal{G}^\bullet)$,
\item
$p^{-1}\mathcal{F}^\bullet \otimes_{f^{-1}\mathcal{O}_S}^\mathbf{L}
q^{-1}\mathcal{G}^\bullet \to
\text{Tot}(p^{-1}\mathcal{F}^\bullet \otimes_{f^{-1}\mathcal{O}_S}
q^{-1}\mathcal{G}^\bullet)$
\item
$\text{Tot}(p^{-1}\mathcal{F}^\bullet \otimes_{f^{-1}\mathcal{O}_S}
q^{-1}\mathcal{G}^\bullet) \to \text{Tot}(\mathcal{F}^\bullet \boxtimes
\mathcal{G}^\bullet)$.
\end{enumerate}
Maps (1) and (2) are pullback maps, map (3) is
the relative cup product, see
Cohomology, Remark \ref{cohomology-remark-cup-product},
map (4) compares the derived and nonderived tensor products, and
map (5) is given by the obvious maps
$p^{-1}\mathcal{F}^i \otimes_{f^{-1}\mathcal{O}_S} q^{-1}\mathcal{G}^j
\to \mathcal{F}^i \boxtimes \mathcal{G}^j$ on the underlying double complexes.

\medskip\noindent
Set $A = \Gamma(S, \mathcal{O}_S)$. There exists a ``global cup product'' map
\begin{equation}
\label{equation-de-rham-kunneth}
R\Gamma(X, \mathcal{F}^\bullet)
\otimes_A^\mathbf{L}
R\Gamma(Y, \mathcal{G}^\bullet)
\longrightarrow
R\Gamma(X \times_S Y,
\text{Tot}(\mathcal{F}^\bullet \boxtimes \mathcal{G}^\bullet))
\end{equation}
in $D(A)$. This is constructed similarly to the relative cup product above
using
\begin{enumerate}
\item $R\Gamma(X, \mathcal{F}^\bullet) \to
R\Gamma(X \times_S Y, p^{-1}\mathcal{F}^\bullet)$
\item $R\Gamma(Y, \mathcal{G}^\bullet) \to
R\Gamma(X \times_S Y, q^{-1}\mathcal{G}^\bullet)$,
\item $R\Gamma(X \times_S Y, p^{-1}\mathcal{F}^\bullet)
\otimes_A^\mathbf{L} R\Gamma(X \times_S Y, q^{-1}\mathcal{G}^\bullet) \to
R\Gamma(X \times_S Y,
p^{-1}\mathcal{F}^\bullet \otimes_{f^{-1}\mathcal{O}_S}^\mathbf{L}
q^{-1}\mathcal{G}^\bullet)$,
\item
$p^{-1}\mathcal{F}^\bullet \otimes_{f^{-1}\mathcal{O}_S}^\mathbf{L}
q^{-1}\mathcal{G}^\bullet \to
\text{Tot}(p^{-1}\mathcal{F}^\bullet \otimes_{f^{-1}\mathcal{O}_S}
q^{-1}\mathcal{G}^\bullet)$
\item
$\text{Tot}(p^{-1}\mathcal{F}^\bullet \otimes_{f^{-1}\mathcal{O}_S}
q^{-1}\mathcal{G}^\bullet) \to \text{Tot}(\mathcal{F}^\bullet \boxtimes
\mathcal{G}^\bullet)$.
\end{enumerate}
Here maps (1) and (2) are the pullback maps, map (3) is the cup product
constructed in Cohomology, Section \ref{cohomology-section-cup-product}.
Maps (4) and (5) are as indicated in the previous paragraph.

\begin{lemma}
\label{lemma-kunneth-special}
In the situation above the cup product (\ref{equation-de-rham-kunneth})
is an isomorphism in $D(A)$ if the following assumptions hold
\begin{enumerate}
\item $S = \Spec(A)$ is affine,
\item $X$ and $Y$ are quasi-compact with affine diagonal,
\item $\mathcal{F}^\bullet$ is bounded,
\item $\mathcal{G}^\bullet$ is bounded below,
\item $\mathcal{F}^n$ is $S$-flat, and
\item $\mathcal{G}^m$ is $S$-flat.
\end{enumerate}
\end{lemma}

\begin{proof}
We will use the notation $\mathcal{A}_{X/S}$ and $\mathcal{A}_{Y/S}$
introduced in Morphisms, Remark
\ref{morphisms-remark-base-change-differential-operators}.
Suppose that we have maps of complexes
$$
\mathcal{F}_1^\bullet \to
\mathcal{F}_2^\bullet \to
\mathcal{F}_3^\bullet \to
\mathcal{F}_1^\bullet[1]
$$
in the category $\mathcal{A}_{X/S}$.
Then by the functoriality of the cup product
we obtain a commutative diagram
$$
\xymatrix{
R\Gamma(X, \mathcal{F}_1^\bullet)
\otimes_A^\mathbf{L}
R\Gamma(Y, \mathcal{G}^\bullet)
\ar[r] \ar[d] &
R\Gamma(X \times_S Y,
\text{Tot}(\mathcal{F}_1^\bullet \boxtimes \mathcal{G}^\bullet)) \ar[d] \\
R\Gamma(X, \mathcal{F}_2^\bullet)
\otimes_A^\mathbf{L}
R\Gamma(Y, \mathcal{G}^\bullet)
\ar[r] \ar[d] &
R\Gamma(X \times_S Y,
\text{Tot}(\mathcal{F}_2^\bullet \boxtimes \mathcal{G}^\bullet)) \ar[d] \\
R\Gamma(X, \mathcal{F}_3^\bullet)
\otimes_A^\mathbf{L}
R\Gamma(Y, \mathcal{G}^\bullet)
\ar[r] \ar[d] &
R\Gamma(X \times_S Y,
\text{Tot}(\mathcal{F}_3^\bullet \boxtimes \mathcal{G}^\bullet)) \ar[d] \\
R\Gamma(X, \mathcal{F}_1^\bullet[1])
\otimes_A^\mathbf{L}
R\Gamma(Y, \mathcal{G}^\bullet)
\ar[r] &
R\Gamma(X \times_S Y,
\text{Tot}(\mathcal{F}_1^\bullet[1] \boxtimes \mathcal{G}^\bullet))
}
$$
If the original maps form a distinguished triangle in the homotopy category
of $\mathcal{A}_{X/S}$, then
the columns of this diagram form distinguished triangles in $D(A)$.

\medskip\noindent
In the situation of the lemma,
suppose that $\mathcal{F}^n = 0$ for $n < i$. Then we may consider the
termwise split short exact sequence of complexes
$$
0 \to \sigma_{\geq i + 1}\mathcal{F}^\bullet \to
\mathcal{F}^\bullet \to \mathcal{F}^i[-i] \to 0
$$
where the truncation is as in
Homology, Section \ref{homology-section-truncations}.
This produces the distinguished triangle
$$
\sigma_{\geq i + 1}\mathcal{F}^\bullet \to
\mathcal{F}^\bullet \to
\mathcal{F}^i[-i] \to
(\sigma_{\geq i + 1}\mathcal{F}^\bullet)[1]
$$
in the homotopy category of $\mathcal{A}_{X/S}$
where the final arrow is given by the boundary map
$\mathcal{F}^i \to \mathcal{F}^{i + 1}$.
It follows from the discussion above that it suffices to prove the lemma for
$\mathcal{F}^i[-i]$ and $\sigma_{\geq i + 1}\mathcal{F}^\bullet$.
Since $\sigma_{\geq i + 1}\mathcal{F}^\bullet$ has fewer nonzero
terms, by induction, if we can prove the lemma if $\mathcal{F}^\bullet$ is
nonzero only in single degree, then the lemma follows.
Thus we may assume $\mathcal{F}^\bullet$ is nonzero only in one degree.

\medskip\noindent
Assume $\mathcal{F}^\bullet$ is the complex which has an $S$-flat quasi-coherent
$\mathcal{O}_X$-module $\mathcal{F}$ sitting in degree $0$ and is zero in
other degrees. Observe that $R\Gamma(X, \mathcal{F})$ has finite
tor dimension by Lemma \ref{lemma-cohomology-de-rham-base-change} for example.
Say it has tor amplitude in $[i, j]$.
Pick $N \gg 0$ and consider the distinguished triangle
$$
\sigma_{\geq N + 1}\mathcal{G}^\bullet \to
\mathcal{G}^\bullet \to
\sigma_{\leq N}\mathcal{G}^\bullet \to
(\sigma_{\geq N + 1}\mathcal{G}^\bullet)[1]
$$
in the homotopy category of $\mathcal{A}_{Y/S}$. Now observe that both
$$
R\Gamma(X, \mathcal{F})
\otimes_A^\mathbf{L}
R\Gamma(Y, \sigma_{\geq N + 1}\mathcal{G}^\bullet)
\quad\text{and}\quad
R\Gamma(X \times_S Y,
\text{Tot}(\mathcal{F} \boxtimes \sigma_{\geq N + 1}\mathcal{G}^\bullet))
$$
have vanishing cohomology in degrees $\leq N + i$. Thus, using the arguments
given above, if we want to prove our statement in a given degree, then we may
assume $\mathcal{G}^\bullet$ is bounded.
Repeating the arguments above one more time we may also assume
$\mathcal{G}^\bullet$ is nonzero only in one degree.
This case is handled by Lemma \ref{lemma-kunneth-single-sheaf}.
\end{proof}







\section{K\"unneth formula for Ext}
\label{section-kunneth-Ext}

\noindent
Consider a cartesian diagram of schemes
$$
\xymatrix{
& X \times_S Y \ar[ld]^p \ar[rd]_q \ar[dd]^f \\
X \ar[rd]_a & & Y \ar[ld]^b \\
& S
}
$$
For $K \in D(\mathcal{O}_X)$ and $M \in D(\mathcal{O}_Y)$
in this section let us define
$$
K \boxtimes M =
Lp^*K \otimes_{\mathcal{O}_{X \times_S Y}}^\mathbf{L} Lq^*M
$$
We claim there is a canonical map
\begin{equation}
\label{equation-kunneth-ext}
Ra_*R\SheafHom(K, K')
\otimes_{\mathcal{O}_S}^\mathbf{L}
Rb_*R\SheafHom(M, M')
\longrightarrow
Rf_*(R\SheafHom(K \boxtimes M, K' \boxtimes M'))
\end{equation}
for $K, K' \in D(\mathcal{O}_X)$ and $M, M' \in D(\mathcal{O}_Y)$.
Namely, we can take the map adjoint to the map
$$
\begin{matrix}
Lf^*\left(Ra_*R\SheafHom(K, K')
\otimes_{\mathcal{O}_S}^\mathbf{L}
Rb_* R\SheafHom(M, M')\right) = \\
Lf^* Ra_* R\SheafHom(K, K')
\otimes_{\mathcal{O}_{X \times_S Y}}^\mathbf{L}
Lf^* Rb_* R\SheafHom(M, M') = \\
Lp^* La^* Ra_* R\SheafHom(K, K')
\otimes_{\mathcal{O}_{X \times_S Y}}^\mathbf{L}
Lq^* Lb^* Rb_* R\SheafHom(M, M') \to \\
Lp^* R\SheafHom(K, K')
\otimes_{\mathcal{O}_{X \times_S Y}}^\mathbf{L}
Lq^* R\SheafHom(M, M') \to \\
R\SheafHom(Lp^*K, Lp^*K')
\otimes_{\mathcal{O}_{X \times_S Y}}^\mathbf{L}
R\SheafHom(Lq^*M, Lq^*M') \to \\
R\SheafHom(K \boxtimes M, K' \boxtimes M')
\end{matrix}
$$
Here the first equality is compatibility of pullbacks with tensor products,
Cohomology, Lemma \ref{cohomology-lemma-pullback-tensor-product}.
The second equality is $f = a \circ p = b \circ q$ and
composition of pullbacks,
Cohomology, Lemma \ref{cohomology-lemma-derived-pullback-composition}.
The first arrow is given by the adjunction maps
$La^* Ra_* \to \text{id}$ and
$Lb^* Rb_* \to \text{id}$ because pushforward and pullback are adjoint,
Cohomology, Lemma \ref{cohomology-lemma-adjoint}.
The second arrow is given by
Cohomology, Remark \ref{cohomology-remark-prepare-fancy-base-change}.
The third and final arrow is
Cohomology, Remark \ref{cohomology-remark-tensor-internal-hom}.
A simple special case of this is the following result.

\begin{lemma}
\label{lemma-kunneth-Ext}
In the situation above, assume $a$ and $b$ are quasi-compact and
quasi-separated and $X$ and $Y$ are tor independent over $S$.
If $K$ is perfect, $K' \in D_\QCoh(\mathcal{O}_X)$, $M$ is perfect, and
$M' \in D_\QCoh(\mathcal{O}_Y)$, then (\ref{equation-kunneth-ext})
is an isomorphism.
\end{lemma}

\begin{proof}
In this case we have $R\SheafHom(K, K') = K' \otimes^\mathbf{L} K^\vee$,
$R\SheafHom(M, M') = M' \otimes^\mathbf{L} M^\vee$, and
$$
R\SheafHom(K \boxtimes M, K' \boxtimes M') =
(K' \otimes^\mathbf{L} K^\vee) \boxtimes
(M' \otimes^\mathbf{L} M^\vee)
$$
See Cohomology, Lemma \ref{cohomology-lemma-dual-perfect-complex}
and we also use that being perfect is preserved by pullback
and by tensor products.
Hence this case follows from Lemma \ref{lemma-kunneth}.
(We omit the verification that with these identifications
we obtain the same map.)
\end{proof}








\section{Cohomology and base change, V}
\label{section-cohomology-base-change}

\noindent
In Section \ref{section-cohomology-and-base-change-perfect}
we saw a base change theorem holds when the morphisms are tor independent.
Even in the affine case there cannot be a base change theorem without such
a condition, see
More on Algebra, Section \ref{more-algebra-section-tor-independence}.
In this section we analyze when one can get a base change result
``one complex at a time''.

\medskip\noindent
To make this work, suppose we have a commutative diagram
$$
\xymatrix{
X' \ar[r]_{g'} \ar[d]_{f'} &
X \ar[d]^f \\
S' \ar[r]^g &
S
}
$$
of schemes (usually we will assume it is cartesian).
Let $K \in D_\QCoh(\mathcal{O}_X)$
and let $L(g')^*K \to K'$ be a map in $D_\QCoh(\mathcal{O}_{X'})$.
For a point $x' \in X'$ set $x = g'(x') \in X$,
$s' = f'(x') \in S'$ and $s = f(x) = g(s')$.
Then we can consider the maps
$$
K_x \otimes_{\mathcal{O}_{S, s}}^\mathbf{L} \mathcal{O}_{S', s'} \to
K_x \otimes_{\mathcal{O}_{X, x}}^\mathbf{L} \mathcal{O}_{X', x'} \to
K'_{x'}
$$
where the first arrow is More on Algebra,
Equation (\ref{more-algebra-equation-comparison-map})
and the second comes from
$(L(g')^*K)_{x'} =
K_x \otimes_{\mathcal{O}_{X, x}}^\mathbf{L} \mathcal{O}_{X', x'}$
and the given map $L(g')^*K \to K'$.
For each $i \in \mathbf{Z}$ we obtain a
$\mathcal{O}_{X, x} \otimes_{\mathcal{O}_{S, s}} \mathcal{O}_{S', s'}$-module
structure on
$H^i(K_x \otimes_{\mathcal{O}_{S, s}}^\mathbf{L} \mathcal{O}_{S', s'})$.
Putting everything together we obtain canonical maps
\begin{equation}
\label{equation-bc}
H^i(K_x \otimes_{\mathcal{O}_{S, s}}^\mathbf{L} \mathcal{O}_{S', s'})
\otimes_{(\mathcal{O}_{X, x} \otimes_{\mathcal{O}_{S, s}} \mathcal{O}_{S', s'})}
\mathcal{O}_{X', x'}
\longrightarrow
H^i(K'_{x'})
\end{equation}
of $\mathcal{O}_{X', x'}$-modules.

\begin{lemma}
\label{lemma-single-complex-base-change-condition}
Let
$$
\xymatrix{
X' \ar[r]_{g'} \ar[d]_{f'} &
X \ar[d]^f \\
S' \ar[r]^g &
S
}
$$
be a cartesian diagram of schemes. Let $K \in D_\QCoh(\mathcal{O}_X)$
and let $L(g')^*K \to K'$ be a map in $D_\QCoh(\mathcal{O}_{X'})$.
The following are equivalent
\begin{enumerate}
\item for any $x' \in X'$ and $i \in \mathbf{Z}$ the map (\ref{equation-bc})
is an isomorphism,
\item for $U \subset X$, $V' \subset S'$ affine open both mapping
into the affine open $V \subset S$ with $U' = V' \times_V U$
the composition
$$
R\Gamma(U, K) \otimes_{\mathcal{O}_S(U)}^\mathbf{L} \mathcal{O}_{S'}(V')
\to
R\Gamma(U, K) \otimes_{\mathcal{O}_X(U)}^\mathbf{L} \mathcal{O}_{X'}(U')
\to
R\Gamma(U', K')
$$
is an isomorphism in $D(\mathcal{O}_{S'}(V'))$, and
\item there is a set $I$ of quadruples $U_i, V_i', V_i, U_i'$, $i \in I$
as in (2) with $X' = \bigcup U'_i$.
\end{enumerate}
\end{lemma}

\begin{proof}
The second arrow in (2) comes from the equality
$$
R\Gamma(U, K) \otimes_{\mathcal{O}_X(U)}^\mathbf{L} \mathcal{O}_{X'}(U') =
R\Gamma(U', L(g')^*K)
$$
of Lemma \ref{lemma-quasi-coherence-pullback} and the given arrow
$L(g')^*K \to K'$. The first arrow of (2) is
More on Algebra, Equation (\ref{more-algebra-equation-comparison-map}).
It is clear that (2) implies (3). Observe that (1) is local on $X'$.
Therefore it suffices to show that if $X$, $S$, $S'$, $X'$ are affine, then
(1) is equivalent to the condition that
$$
R\Gamma(X, K) \otimes_{\mathcal{O}_S(S)}^\mathbf{L} \mathcal{O}_{S'}(S')
\to
R\Gamma(X, K) \otimes_{\mathcal{O}_X(X)}^\mathbf{L} \mathcal{O}_{X'}(X')
\to
R\Gamma(X', K')
$$
is an isomorphism in $D(\mathcal{O}_{S'}(S'))$. Say
$S = \Spec(R)$, $X = \Spec(A)$, $S' = \Spec(R')$, $X' = \Spec(A')$,
$K$ corresponds to the complex $M^\bullet$ of $A$-modules, and
$K'$ corresponds to the complex $N^\bullet$ of $A'$-modules.
Note that $A' = A \otimes_R R'$. The condition above is that the composition
$$
M^\bullet \otimes_R^\mathbf{L} R' \to
M^\bullet \otimes_A^\mathbf{L} A' \to
N^\bullet
$$
is an isomorphism in $D(R')$. Equivalently, it is that for all
$i \in \mathbf{Z}$ the map
$$
H^i(M^\bullet \otimes_R^\mathbf{L} R') \to
H^i(M^\bullet \otimes_A^\mathbf{L} A') \to
H^i(N^\bullet)
$$
is an isomorphism. Observe that this is a map of $A \otimes_R R'$-modules,
i.e., of $A'$-modules. On the other hand, (1) is the requirement
that for compatible primes
$\mathfrak q' \subset A'$, $\mathfrak q \subset A$,
$\mathfrak p' \subset R'$, $\mathfrak p \subset R$
the composition
$$
H^i(M^\bullet_\mathfrak q \otimes_{R_\mathfrak p}^\mathbf{L} R'_{\mathfrak p'})
\otimes_{(A_\mathfrak q \otimes_{R_\mathfrak p} R'_{\mathfrak p'})}
A'_{\mathfrak q'} \to
H^i(M^\bullet_{\mathfrak q}
\otimes_{A_\mathfrak q}^\mathbf{L} A'_{\mathfrak q'})
\to H^i(N^\bullet_{\mathfrak q'})
$$
is an isomorphism. Since
$$
H^i(M^\bullet_\mathfrak q \otimes_{R_\mathfrak p}^\mathbf{L} R'_{\mathfrak p'})
\otimes_{(A_\mathfrak q \otimes_{R_\mathfrak p} R'_{\mathfrak p'})}
A'_{\mathfrak q'} =
H^i(M^\bullet \otimes_R^\mathbf{L} R') \otimes_{A'} A'_{\mathfrak q'}
$$
is the localization at $\mathfrak q'$,
we see that these two conditions are equivalent by
Algebra, Lemma \ref{algebra-lemma-characterize-zero-local}.
\end{proof}

\begin{lemma}
\label{lemma-single-complex-base-change}
Let
$$
\xymatrix{
X' \ar[r]_{g'} \ar[d]_{f'} &
X \ar[d]^f \\
S' \ar[r]^g &
S
}
$$
be a cartesian diagram of schemes. Let $K \in D_\QCoh(\mathcal{O}_X)$
and let $L(g')^*K \to K'$ be a map in $D_\QCoh(\mathcal{O}_{X'})$.
If
\begin{enumerate}
\item the equivalent conditions of
Lemma \ref{lemma-single-complex-base-change-condition} hold, and
\item $f$ is quasi-compact and quasi-separated,
\end{enumerate}
then the composition $Lg^*Rf_*K \to Rf'_*L(g')^*K \to Rf'_*K'$
is an isomorphism.
\end{lemma}

\begin{proof}
We could prove this using the same method as in the proof of
Lemma \ref{lemma-compare-base-change} but instead we will prove
it using the induction principle and relative Mayer-Vietoris.

\medskip\noindent
To check the map is an isomorphism we may work locally on $S'$.
Hence we may assume $g : S' \to S$ is a morphism of affine schemes.
In particular $X$ is a quasi-compact and quasi-separated scheme.
We will use the induction principle of
Cohomology of Schemes, Lemma \ref{coherent-lemma-induction-principle}
to prove that for any quasi-compact open $U \subset X$ the similarly
constructed map $Lg^*R(U \to S)_*K|_U \to R(U' \to S')_*K'|_{U'}$
is an isomorphism. Here $U' = (g')^{-1}(U)$.

\medskip\noindent
If $U \subset X$ is an affine open, then we find that the result is
true by assumption, see
Lemma \ref{lemma-single-complex-base-change-condition} part (2)
and the translation into algebra afforded to us
by Lemmas \ref{lemma-affine-compare-bounded} and
\ref{lemma-quasi-coherence-pullback}.

\medskip\noindent
The induction step. Suppose that $X = U \cup V$ is an open covering
with $U$, $V$, $U \cap V$
quasi-compact such that the result holds for $U$, $V$, and $U \cap V$.
Denote $a = f|_U$, $b = f|_V$ and $c = f|_{U \cap V}$.
Let $a' : U' \to S'$, $b' : V' \to S'$ and $c' : U' \cap V' \to S'$
be the base changes of $a$, $b$, and $c$.
Using the distinguished triangles from relative Mayer-Vietoris
(Cohomology, Lemma \ref{cohomology-lemma-unbounded-relative-mayer-vietoris})
we obtain a commutative diagram
$$
\xymatrix{
Lg^*Rf_*K \ar[r] \ar[d] &
Rf'_* K' \ar[d] \\
Lg^*Ra_* K|_U \oplus
Lg^*Rb_* K|_V \ar[r] \ar[d] &
Ra'_* K'|_{U'} \oplus
Rb'_* K'|_{V'} \ar[d] \\
Lg^*Rc_* K|_{U \cap V} \ar[r] \ar[d] &
Rc'_* K'|_{U' \cap V'} \ar[d] \\
Lg^*Rf_* K[1] \ar[r] &
Rf'_* K'[1]
}
$$
Since the 2nd and 3rd horizontal arrows are isomorphisms so is the first
(Derived Categories, Lemma \ref{derived-lemma-third-isomorphism-triangle})
and the proof of the lemma is finished.
\end{proof}

\begin{lemma}
\label{lemma-single-complex-base-change-condition-inherited}
Let
$$
\xymatrix{
X' \ar[r]_{g'} \ar[d]_{f'} &
X \ar[d]^f \\
S' \ar[r]^g &
S
}
$$
be a cartesian diagram of schemes. Let $K \in D_\QCoh(\mathcal{O}_X)$
and let $L(g')^*K \to K'$ be a map in $D_\QCoh(\mathcal{O}_{X'})$.
If the equivalent conditions of
Lemma \ref{lemma-single-complex-base-change-condition} hold, then
\begin{enumerate}
\item for $E \in D_\QCoh(\mathcal{O}_X)$ the equivalent
conditions of Lemma \ref{lemma-single-complex-base-change-condition} hold
for $L(g')^*(E \otimes^\mathbf{L} K) \to L(g')^*E \otimes^\mathbf{L} K'$,
\item if $E$ in $D(\mathcal{O}_X)$ is perfect the equivalent conditions of
Lemma \ref{lemma-single-complex-base-change-condition} hold for
$L(g')^*R\SheafHom(E, K) \to R\SheafHom(L(g')^*E, K')$, and
\item if $K$ is bounded below and $E$ in $D(\mathcal{O}_X)$
pseudo-coherent the equivalent conditions of
Lemma \ref{lemma-single-complex-base-change-condition} hold for
$L(g')^*R\SheafHom(E, K) \to R\SheafHom(L(g')^*E, K')$.
\end{enumerate}
\end{lemma}

\begin{proof}
The statement makes sense as the complexes involved have quasi-coherent
cohomology sheaves by Lemmas
\ref{lemma-quasi-coherence-pullback},
\ref{lemma-quasi-coherence-tensor-product}, and
\ref{lemma-quasi-coherence-internal-hom} and
Cohomology, Lemmas \ref{cohomology-lemma-pseudo-coherent-pullback} and
\ref{cohomology-lemma-perfect-pullback}.
Having said this, we can check the maps (\ref{equation-bc})
are isomorphisms in case (1) by computing the source and target
of (\ref{equation-bc}) using the transitive property of tensor product, see
More on Algebra, Lemma \ref{more-algebra-lemma-triple-tensor-product}.
The map in (2) and (3) is the composition
$$
L(g')^*R\SheafHom(E, K) \to R\SheafHom(L(g')^*E, L(g')^*K)
\to R\SheafHom(L(g')^*E, K')
$$
where the first arrow is
Cohomology, Remark \ref{cohomology-remark-prepare-fancy-base-change}
and the second arrow comes from the given map $L(g')^*K \to K'$.
To prove the maps (\ref{equation-bc}) are isomorphisms one represents
$E_x$ by a bounded complex of finite projective $\mathcal{O}_{X. x}$-modules
in case (2) or by a bounded above complex of finite free modules in case (3)
and computes the source and target of the arrow.
Some details omitted.
\end{proof}

\begin{lemma}
\label{lemma-base-change-tensor}
Let $f : X \to S$ be a quasi-compact and quasi-separated morphism of
schemes. Let $E \in D_\QCoh(\mathcal{O}_X)$. Let $\mathcal{G}^\bullet$
be a bounded above complex of quasi-coherent
$\mathcal{O}_X$-modules flat over $S$. Then formation of
$$
Rf_*(E \otimes^\mathbf{L}_{\mathcal{O}_X} \mathcal{G}^\bullet)
$$
commutes with arbitrary base change (see proof for precise statement).
\end{lemma}

\begin{proof}
The statement means the following. Let $g : S' \to S$ be a morphism of
schemes and consider the base change diagram
$$
\xymatrix{
X' \ar[r]_{g'} \ar[d]_{f'} &
X \ar[d]^f \\
S' \ar[r]^g &
S
}
$$
in other words $X' = S' \times_S X$. The lemma asserts that
$$
Lg^*Rf_*(E \otimes^\mathbf{L}_{\mathcal{O}_X} \mathcal{G}^\bullet)
\longrightarrow
Rf'_*\left(
L(g')^*E \otimes^\mathbf{L}_{\mathcal{O}_{X'}} (g')^*\mathcal{G}^\bullet
\right)
$$
is an isomorphism. Observe that on the right hand side we do {\bf not}
use the derived pullback on $\mathcal{G}^\bullet$.
To prove this, we apply Lemmas \ref{lemma-single-complex-base-change} and
\ref{lemma-single-complex-base-change-condition-inherited} to see that it
suffices to prove the canonical map
$$
L(g')^*\mathcal{G}^\bullet \to (g')^*\mathcal{G}^\bullet
$$
satisfies the equivalent conditions of
Lemma \ref{lemma-single-complex-base-change-condition}.
This follows by checking the condition on stalks, where it
immediately follows from the fact that
$\mathcal{G}^\bullet_x \otimes_{\mathcal{O}_{S, s}} \mathcal{O}_{S', s'}$
computes the derived tensor product by our assumptions on the complex
$\mathcal{G}^\bullet$.
\end{proof}

\begin{lemma}
\label{lemma-base-change-RHom}
Let $f : X \to S$ be a quasi-compact and quasi-separated morphism of schemes.
Let $E$ be an object of $D(\mathcal{O}_X)$.
Let $\mathcal{G}^\bullet$ be a complex of
quasi-coherent $\mathcal{O}_X$-modules. If
\begin{enumerate}
\item $E$ is perfect, $\mathcal{G}^\bullet$ is a bounded above,
and $\mathcal{G}^n$ is flat over $S$, or
\item $E$ is pseudo-coherent, $\mathcal{G}^\bullet$ is bounded,
and $\mathcal{G}^n$ is flat over $S$,
\end{enumerate}
then formation of
$$
Rf_*R\SheafHom(E, \mathcal{G}^\bullet)
$$
commutes with arbitrary base change (see proof for precise statement).
\end{lemma}

\begin{proof}
The statement means the following. Let $g : S' \to S$ be a morphism of
schemes and consider the base change diagram
$$
\xymatrix{
X' \ar[r]_{g'} \ar[d]_{f'} &
X \ar[d]^f \\
S' \ar[r]^g &
S
}
$$
in other words $X' = S' \times_S X$. The lemma asserts that
$$
Lg^*Rf_*R\SheafHom(E, \mathcal{G}^\bullet)
\longrightarrow
R(f')_*R\SheafHom(L(g')^*E, (g')^*\mathcal{G}^\bullet)
$$
is an isomorphism. Observe that on the right hand side we do {\bf not}
use the derived pullback on $\mathcal{G}^\bullet$. To prove this, we apply
Lemmas \ref{lemma-single-complex-base-change} and
\ref{lemma-single-complex-base-change-condition-inherited} to see that it
suffices to prove the canonical map
$$
L(g')^*\mathcal{G}^\bullet \to (g')^*\mathcal{G}^\bullet
$$
satisfies the equivalent conditions of
Lemma \ref{lemma-single-complex-base-change-condition}.
This was shown in the proof of Lemma \ref{lemma-base-change-tensor}.
\end{proof}





\section{Producing perfect complexes}
\label{section-producing-perfect}

\noindent
The following lemma is our main technical tool for producing
perfect complexes. Later versions of this result will reduce to
this by Noetherian approximation, see
Section \ref{section-cohomology-and-base-change-final}.

\begin{lemma}
\label{lemma-perfect-direct-image}
Let $S$ be a Noetherian scheme. Let $f : X \to S$ be a morphism of schemes
which is locally of finite type. Let $E \in D(\mathcal{O}_X)$ such that
\begin{enumerate}
\item $E \in D^b_{\textit{Coh}}(\mathcal{O}_X)$,
\item the support of $H^i(E)$ is proper over $S$ for all $i$, and
\item $E$ has finite tor dimension as an object of $D(f^{-1}\mathcal{O}_S)$.
\end{enumerate}
Then $Rf_*E$ is a perfect object of $D(\mathcal{O}_S)$.
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-direct-image-coherent} we see that $Rf_*E$ is an object of
$D^b_{\textit{Coh}}(\mathcal{O}_S)$. Hence $Rf_*E$ is pseudo-coherent
(Lemma \ref{lemma-identify-pseudo-coherent-noetherian}).
Hence it suffices to show that $Rf_*E$ has finite tor dimension, see
Cohomology, Lemma \ref{cohomology-lemma-perfect}.
By Lemma \ref{lemma-tor-qc-qs} it suffices to check that
$Rf_*(E) \otimes_{\mathcal{O}_S}^\mathbf{L} \mathcal{F}$
has universally bounded cohomology for all quasi-coherent
sheaves $\mathcal{F}$ on $S$. Bounded from above is clear as $Rf_*(E)$
is bounded from above. Let $T \subset X$ be the union of the supports
of $H^i(E)$ for all $i$. Then $T$ is proper over $S$ by assumptions
(1) and (2), see Cohomology of Schemes, Lemma
\ref{coherent-lemma-union-closed-proper-over-base}.
In particular there exists a quasi-compact open
$X' \subset X$ containing $T$. Setting $f' = f|_{X'}$ we have
$Rf_*(E) = Rf'_*(E|_{X'})$ because $E$ restricts to zero on $X \setminus T$.
Thus we may replace $X$ by $X'$ and assume $f$ is quasi-compact.
Moreover, $f$ is quasi-separated by Morphisms, Lemma
\ref{morphisms-lemma-finite-type-Noetherian-quasi-separated}. Now
$$
Rf_*(E) \otimes_{\mathcal{O}_S}^\mathbf{L} \mathcal{F} =
Rf_*\left(E \otimes_{\mathcal{O}_X}^\mathbf{L} Lf^*\mathcal{F}\right) =
Rf_*\left(E \otimes_{f^{-1}\mathcal{O}_S}^\mathbf{L} f^{-1}\mathcal{F}\right)
$$
by
Lemma \ref{lemma-cohomology-base-change}
and
Cohomology, Lemma \ref{cohomology-lemma-variant-derived-pullback}.
By assumption (3) the complex
$E \otimes_{f^{-1}\mathcal{O}_S}^\mathbf{L} f^{-1}\mathcal{F}$
has cohomology sheaves in a
given finite range, say $[a, b]$. Then $Rf_*$ of it
has cohomology in the range $[a, \infty)$ and we win.
\end{proof}

\begin{lemma}
\label{lemma-tensor-perfect}
Let $S$ be a Noetherian scheme. Let $f : X \to S$ be a morphism of schemes
which is locally of finite type. Let $E \in D(\mathcal{O}_X)$ be perfect.
Let $\mathcal{G}^\bullet$ be a bounded complex of coherent
$\mathcal{O}_X$-modules flat over $S$ with support proper over $S$.
Then $K = Rf_*(E \otimes_{\mathcal{O}_X}^\mathbf{L} \mathcal{G}^\bullet)$
is a perfect object of $D(\mathcal{O}_S)$.
\end{lemma}

\begin{proof}
The object $K$ is perfect by Lemma \ref{lemma-perfect-direct-image}.
We check the lemma applies: Locally $E$ is isomorphic to a finite complex
of finite free $\mathcal{O}_X$-modules. Hence locally
$E \otimes^\mathbf{L}_{\mathcal{O}_X} \mathcal{G}^\bullet$ is isomorphic
to a finite complex whose terms are of the form
$$
\bigoplus\nolimits_{i = a, \ldots, b} (\mathcal{G}^i)^{\oplus r_i}
$$
for some integers $a, b, r_a, \ldots, r_b$. This immediately implies the
cohomology sheaves $H^i(E \otimes^\mathbf{L}_{\mathcal{O}_X} \mathcal{G})$
are coherent. The hypothesis on the tor dimension also follows as
$\mathcal{G}^i$ is flat over $f^{-1}\mathcal{O}_S$.
\end{proof}

\begin{lemma}
\label{lemma-ext-perfect}
Let $S$ be a Noetherian scheme. Let $f : X \to S$ be a morphism of schemes
which is locally of finite type. Let $E \in D(\mathcal{O}_X)$ be perfect.
Let $\mathcal{G}^\bullet$ be a bounded complex of coherent
$\mathcal{O}_X$-modules flat over $S$ with support proper over $S$.
Then $K = Rf_*R\SheafHom(E, \mathcal{G}^\bullet)$ is a perfect object of
$D(\mathcal{O}_S)$.
\end{lemma}

\begin{proof}
Since $E$ is a perfect complex there exists a dual perfect complex
$E^\vee$, see Cohomology, Lemma \ref{cohomology-lemma-dual-perfect-complex}.
Observe that $R\SheafHom(E, \mathcal{G}^\bullet) =
E^\vee \otimes^\mathbf{L}_{\mathcal{O}_X} \mathcal{G}^\bullet$.
Thus the perfectness of $K$ follows from Lemma \ref{lemma-tensor-perfect}.
\end{proof}

\noindent
We will generalize the following lemma to flat and proper morphisms
over general bases in
Lemma \ref{lemma-flat-proper-perfect-direct-image-general}
and to perfect proper morphisms in
More on Morphisms, Lemma
\ref{more-morphisms-lemma-perfect-proper-perfect-direct-image}.

\begin{lemma}
\label{lemma-flat-proper-perfect-direct-image}
Let $S$ be a Noetherian scheme. Let $f : X \to S$ be a flat proper
morphism of schemes. Let $E \in D(\mathcal{O}_X)$ be perfect. Then
$Rf_*E$ is a perfect object of $D(\mathcal{O}_S)$.
\end{lemma}

\begin{proof}
We claim that Lemma \ref{lemma-perfect-direct-image} applies.
Conditions (1) and (2) are immediate. Condition (3) is local
on $X$. Thus we may assume $X$ and $S$ affine and $E$
represented by a strictly perfect complex of $\mathcal{O}_X$-modules.
Since $\mathcal{O}_X$ is flat as a sheaf of $f^{-1}\mathcal{O}_S$-modules
we find that condition (3) is satisfied.
\end{proof}






\section{A projection formula for Ext}
\label{section-ext}

\noindent
Lemma \ref{lemma-compute-ext} (or similar results in the literature)
is sometimes used to verify one of Artin's criteria for
Quot functors, Hilbert schemes, and other moduli problems.
Suppose that $f : X \to S$ is a proper, flat, finitely presented
morphism of schemes and $E \in D(\mathcal{O}_X)$ is perfect.
Here the lemma says
$$
\Ext^i_X(E, f^*\mathcal{F}) =
\Ext^i_S((Rf_*E^\vee)^\vee, \mathcal{F})
$$
for $\mathcal{F}$ quasi-coherent on $S$.
Writing it this way makes it look like a projection formula
for Ext and indeed the result follows rather
easily from Lemma \ref{lemma-cohomology-base-change}.

\begin{lemma}
\label{lemma-compute-tensor-perfect}
Assumptions and notation as in Lemma \ref{lemma-tensor-perfect}.
Then there are functorial isomorphisms
$$
H^i(S, K \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F})
\longrightarrow
H^i(X, E \otimes_{\mathcal{O}_X}^\mathbf{L}
(\mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F}))
$$
for $\mathcal{F}$ quasi-coherent on $S$
compatible with boundary maps (see proof).
\end{lemma}

\begin{proof}
We have
$$
\mathcal{G}^\bullet \otimes_{\mathcal{O}_X}^\mathbf{L} Lf^*\mathcal{F} =
\mathcal{G}^\bullet \otimes_{f^{-1}\mathcal{O}_S}^\mathbf{L} f^{-1}\mathcal{F} =
\mathcal{G}^\bullet \otimes_{f^{-1}\mathcal{O}_S} f^{-1}\mathcal{F} =
\mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F}
$$
the first equality by
Cohomology, Lemma \ref{cohomology-lemma-variant-derived-pullback},
the second as $\mathcal{G}^n$ is a flat $f^{-1}\mathcal{O}_S$-module, and
the third by definition of pullbacks. Hence we obtain
\begin{align*}
H^i(X, E \otimes^\mathbf{L}_{\mathcal{O}_X}
(\mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F}))
& =
H^i(X, E \otimes^\mathbf{L}_{\mathcal{O}_X} \mathcal{G}^\bullet
\otimes_{\mathcal{O}_X}^\mathbf{L} Lf^*\mathcal{F}) \\
& =
H^i(S,
Rf_*(E \otimes^\mathbf{L}_{\mathcal{O}_X} \mathcal{G}^\bullet
\otimes^\mathbf{L}_{\mathcal{O}_X} Lf^*\mathcal{F})) \\
& =
H^i(S, Rf_*(E \otimes^\mathbf{L}_{\mathcal{O}_X} \mathcal{G}^\bullet)
\otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F}) \\
& =
H^i(S, K \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F}) 
\end{align*}
The first equality by the above, the second by Leray
(Cohomology, Lemma \ref{cohomology-lemma-before-Leray}), and
the third equality by Lemma \ref{lemma-cohomology-base-change}.
The statement on boundary maps means the following: Given a short
exact sequence $0 \to \mathcal{F}_1 \to \mathcal{F}_2 \to \mathcal{F}_3 \to 0$
of quasi-coherent $\mathcal{O}_S$-modules, the isomorphisms fit into
commutative diagrams
$$
\xymatrix{
H^i(S, K \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F}_3)
\ar[r] \ar[d]_\delta &
H^i(X, E \otimes^\mathbf{L}_{\mathcal{O}_X}
(\mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F}_3))
\ar[d]^\delta \\
H^{i + 1}(S, K \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F}_1)
\ar[r] &
H^{i + 1}(X, E \otimes^\mathbf{L}_{\mathcal{O}_X}
(\mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F}_1))
}
$$
where the boundary maps come from the distinguished triangle
$$
K \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F}_1 \to
K \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F}_2 \to
K \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F}_3 \to
K \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F}_1[1]
$$
and the distinguished triangle in $D(\mathcal{O}_X)$ associated to
the short exact sequence
$$
0 \to
\mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F}_1 \to
\mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F}_2 \to
\mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F}_3 \to 0
$$
of complexes of $\mathcal{O}_X$-modules.
This sequence is exact because $\mathcal{G}^n$ is flat over $S$.
We omit the verification of the commutativity of the displayed diagram.
\end{proof}

\begin{lemma}
\label{lemma-compute-ext-perfect}
Assumptions and notation as in Lemma \ref{lemma-ext-perfect}.
Then there are functorial isomorphisms
$$
H^i(S, K \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F})
\longrightarrow
\Ext^i_{\mathcal{O}_X}(E,
\mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F})
$$
for $\mathcal{F}$ quasi-coherent on $S$
compatible with boundary maps (see proof).
\end{lemma}

\begin{proof}
As in the proof of Lemma \ref{lemma-ext-perfect} let $E^\vee$ be the
dual perfect complex and recall that
$K = Rf_*(E^\vee \otimes_{\mathcal{O}_X}^\mathbf{L} \mathcal{G}^\bullet)$.
Since we also have
$$
\Ext^i_{\mathcal{O}_X}(E,
\mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F})
=
H^i(X, E^\vee \otimes^\mathbf{L}_{\mathcal{O}_X}
(\mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F}))
$$
by construction of $E^\vee$, the existence of the isomorphisms follows
from Lemma \ref{lemma-compute-tensor-perfect} applied to $E^\vee$
and $\mathcal{G}^\bullet$.
The statement on boundary maps means the following: Given a short
exact sequence $0 \to \mathcal{F}_1 \to \mathcal{F}_2 \to \mathcal{F}_3 \to 0$
then the isomorphisms fit into commutative diagrams
$$
\xymatrix{
H^i(S, K \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F}_3)
\ar[r] \ar[d]_\delta &
\Ext^i_{\mathcal{O}_X}(E,
\mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F}_3) \ar[d]^\delta \\
H^{i + 1}(S, K \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F}_1)
\ar[r] &
\Ext^{i + 1}_{\mathcal{O}_X}(E,
\mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F}_1)
}
$$
where the boundary maps come from the distinguished triangle
$$
K \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F}_1 \to
K \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F}_2 \to
K \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F}_3 \to
K \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F}_1[1]
$$
and the distinguished triangle in $D(\mathcal{O}_X)$ associated to
the short exact sequence
$$
0 \to
\mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F}_1 \to
\mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F}_2 \to
\mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F}_3 \to 0
$$
of complexes.
This sequence is exact because $\mathcal{G}$ is flat over $S$.
We omit the verification of the commutativity of the displayed diagram.
\end{proof}

\begin{lemma}
\label{lemma-compute-ext}
Let $f : X \to S$ be a morphism of schemes, $E \in D(\mathcal{O}_X)$
and $\mathcal{G}^\bullet$ a complex of $\mathcal{O}_X$-modules.
Assume
\begin{enumerate}
\item $S$ is Noetherian,
\item $f$ is locally of finite type,
\item $E \in D^-_{\textit{Coh}}(\mathcal{O}_X)$,
\item $\mathcal{G}^\bullet$ is a bounded complex of
coherent $\mathcal{O}_X$-modules flat over $S$ with support proper over $S$.
\end{enumerate}
Then the following two statements are true
\begin{enumerate}
\item[(A)] for every $m \in \mathbf{Z}$ there exists a perfect object $K$
of $D(\mathcal{O}_S)$ and functorial maps
$$
\alpha^i_\mathcal{F} :
\Ext^i_{\mathcal{O}_X}(E,
\mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F})
\longrightarrow
H^i(S, K \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F})
$$
for $\mathcal{F}$ quasi-coherent on $S$ compatible with boundary maps
(see proof) such that $\alpha^i_\mathcal{F}$ is an isomorphism for $i \leq m$
\item[(B)] there exists a pseudo-coherent $L \in D(\mathcal{O}_S)$
and functorial isomorphisms
$$
\Ext^i_{\mathcal{O}_S}(L, \mathcal{F}) \longrightarrow
\Ext^i_{\mathcal{O}_X}(E,
\mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F})
$$
for $\mathcal{F}$ quasi-coherent on $S$ compatible with boundary maps.
\end{enumerate}
\end{lemma}

\begin{proof}
Proof of (A).
Suppose $\mathcal{G}^i$ is nonzero only for $i \in [a, b]$.
We may replace $X$ by a quasi-compact open neighbourhood of
the union of the supports of $\mathcal{G}^i$.
Hence we may assume $X$ is Noetherian.
In this case $X$ and $f$ are quasi-compact and quasi-separated.
Choose an approximation $P \to E$ by a perfect complex $P$ of
$(X, E, -m - 1 + a)$
(possible by Theorem \ref{theorem-approximation}).
Then the induced map
$$
\Ext^i_{\mathcal{O}_X}(E,
\mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F})
\longrightarrow
\Ext^i_{\mathcal{O}_X}(P,
\mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F})
$$
is an isomorphism for $i \leq m$. Namely, the kernel, resp.\ cokernel of this
map is a quotient, resp.\ submodule of
$$
\Ext^i_{\mathcal{O}_X}(C,
\mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F})
\quad\text{resp.}\quad
\Ext^{i + 1}_{\mathcal{O}_X}(C,
\mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F})
$$
where $C$ is the cone of $P \to E$. Since $C$ has vanishing cohomology
sheaves in degrees $\geq -m - 1 + a$ these $\Ext$-groups are zero
for $i \leq m + 1$ by
Derived Categories, Lemma \ref{derived-lemma-negative-exts}.
This reduces us to the case that
$E$ is a perfect complex which is Lemma \ref{lemma-compute-ext-perfect}.
The statement on boundaries is explained in the proof of
Lemma \ref{lemma-compute-ext-perfect}.

\medskip\noindent
Proof of (B). As in the proof of (A) we may assume $X$ is Noetherian.
Observe that $E$ is pseudo-coherent by
Lemma \ref{lemma-identify-pseudo-coherent-noetherian}.
By Lemma \ref{lemma-pseudo-coherent-hocolim} we can write
$E = \text{hocolim} E_n$ with $E_n$ perfect and $E_n \to E$ inducing
an isomorphism on truncations $\tau_{\geq -n}$. Let $E_n^\vee$
be the dual perfect complex
(Cohomology, Lemma \ref{cohomology-lemma-dual-perfect-complex}).
We obtain an inverse system $\ldots \to E_3^\vee \to E_2^\vee \to E_1^\vee$
of perfect objects. This in turn gives rise to an inverse system
$$
\ldots \to K_3 \to K_2 \to K_1\quad\text{with}\quad
K_n = Rf_*(E_n^\vee \otimes_{\mathcal{O}_X}^\mathbf{L} \mathcal{G}^\bullet)
$$
perfect on $S$, see Lemma \ref{lemma-tensor-perfect}.
By Lemma \ref{lemma-compute-ext-perfect} and its proof and
by the arguments in the previous paragraph (with $P = E_n$)
for any quasi-coherent $\mathcal{F}$ on $S$ we have
functorial canonical maps
$$
\xymatrix{
& \Ext^i_{\mathcal{O}_X}(E,
\mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F})
\ar[ld] \ar[rd] \\
H^i(S, K_{n + 1} \otimes_{\mathcal{O}_S}^\mathbf{L} \mathcal{F})
\ar[rr] & &
H^i(S, K_n \otimes_{\mathcal{O}_S}^\mathbf{L} \mathcal{F})
}
$$
which are isomorphisms for $i \leq n + a$.
Let $L_n = K_n^\vee$ be the dual perfect complex.
Then we see that $L_1 \to L_2 \to L_3 \to \ldots$
is a system of perfect objects in $D(\mathcal{O}_S)$
such that for any quasi-coherent $\mathcal{F}$ on $S$
the maps
$$
\Ext^i_{\mathcal{O}_S}(L_{n + 1}, \mathcal{F})
\longrightarrow
\Ext^i_{\mathcal{O}_S}(L_n, \mathcal{F})
$$
are isomorphisms for $i \leq n + a - 1$. This implies that
$L_n \to L_{n + 1}$ induces an isomorphism on truncations
$\tau_{\geq -n - a + 2}$ (hint: take cone of $L_n \to L_{n + 1}$
and look at its last nonvanishing cohomology sheaf).
Thus $L = \text{hocolim} L_n$ is pseudo-coherent, see
Lemma \ref{lemma-pseudo-coherent-hocolim}. The mapping property
of homotopy colimits gives that
$\Ext^i_{\mathcal{O}_S}(L, \mathcal{F}) =
\Ext^i_{\mathcal{O}_S}(L_n, \mathcal{F})$
for $i \leq n + a - 3$ which finishes the proof.
\end{proof}

\begin{remark}
\label{remark-base-change-of-L}
The pseudo-coherent complex $L$ of part (B) of Lemma \ref{lemma-compute-ext}
is canonically associated to the situation. For example,
formation of $L$ as in (B) is compatible with base change.
In other words, given a cartesian diagram
$$
\xymatrix{
X' \ar[r]_{g'} \ar[d]_{f'} &
X \ar[d]^f \\
S' \ar[r]^g &
S
}
$$
of schemes we have canonical functorial isomorphisms
$$
\Ext^i_{\mathcal{O}_{S'}}(Lg^*L, \mathcal{F}') \longrightarrow
\Ext^i_{\mathcal{O}_X}(L(g')^*E,
(g')^*\mathcal{G}^\bullet \otimes_{\mathcal{O}_{X'}} (f')^*\mathcal{F}')
$$
for $\mathcal{F}'$ quasi-coherent on $S'$. Obsere that we do {\bf not} use
derived pullback on $\mathcal{G}^\bullet$ on the right hand side.
If we ever need this, we will
formulate a precise result here and give a detailed proof.
\end{remark}






\section{Limits and derived categories}
\label{section-limits}

\noindent
In this section we collect some results about the derived category
of a scheme which is the limit of an inverse system of schemes.
More precisely, we will work in the following setting.

\begin{situation}
\label{situation-descent}
Let $S = \lim_{i \in I} S_i$ be a limit of a directed system of schemes
with affine transition morphisms $f_{i'i} : S_{i'} \to S_i$.
We assume that $S_i$ is quasi-compact and quasi-separated for all $i \in I$.
We denote $f_i : S \to S_i$ the projection. We also fix an element $0 \in I$.
\end{situation}

\begin{lemma}
\label{lemma-descend-homomorphisms}
In Situation \ref{situation-descent}.
Let $E_0$ and $K_0$ be objects of
$D(\mathcal{O}_{S_0})$.
Set $E_i = Lf_{i0}^*E_0$ and $K_i = Lf_{i0}^*K_0$ for $i \geq 0$
and set $E = Lf_0^*E_0$ and $K = Lf_0^*K_0$. Then the map
$$
\colim_{i \geq 0} \Hom_{D(\mathcal{O}_{S_i})}(E_i, K_i)
\longrightarrow
\Hom_{D(\mathcal{O}_S)}(E, K)
$$
is an isomorphism if either
\begin{enumerate}
\item $E_0$ is perfect and $K_0 \in D_\QCoh(\mathcal{O}_{S_0})$, or
\item $E_0$ is pseudo-coherent and
$K_0 \in D_\QCoh(\mathcal{O}_{S_0})$ has finite tor dimension.
\end{enumerate}
\end{lemma}

\begin{proof}
For every open $U_0 \subset S_0$ consider the condition $P$ that the canonical
map
$$
\colim_{i \geq 0} \Hom_{D(\mathcal{O}_{U_i})}(E_i|_{U_i}, K_i|_{U_i})
\longrightarrow
\Hom_{D(\mathcal{O}_U)}(E|_U, K|_U)
$$
is an isomorphism, where $U = f_0^{-1}(U_0)$ and $U_i = f_{i0}^{-1}(U_0)$.
We will prove $P$ holds for all quasi-compact opens $U_0$
by the induction principle of
Cohomology of Schemes, Lemma \ref{coherent-lemma-induction-principle}.
Condition (2) of this lemma follows immediately from Mayer-Vietoris
for hom in the derived category, see
Cohomology, Lemma \ref{cohomology-lemma-mayer-vietoris-hom}.
Thus it suffices to prove the lemma when $S_0$ is affine.

\medskip\noindent
Assume $S_0$ is affine. Say $S_0 = \Spec(A_0)$, $S_i = \Spec(A_i)$, and
$S = \Spec(A)$. We will use Lemma \ref{lemma-affine-compare-bounded}
without further mention.

\medskip\noindent
In case (1) the object $E_0^\bullet$ corresponds to a finite complex
of finite projective $A_0$-modules, see Lemma \ref{lemma-perfect-affine}.
We may represent the object $K_0$ by a K-flat complex $K_0^\bullet$
of $A_0$-modules. In this situation we are trying to prove
$$
\colim_{i \geq 0} \Hom_{D(A_i)}(E_0^\bullet \otimes_{A_0} A_i,
K_0^\bullet \otimes_{A_0} A_i)
\longrightarrow
\Hom_{D(A)}(E_0^\bullet \otimes_{A_0} A, K_0^\bullet \otimes_{A_0} A)
$$
Because $E_0^\bullet$ is a bounded above complex of projective modules
we can rewrite this as
$$
\colim_{i \geq 0} \Hom_{K(A_0)}(E_0^\bullet,
K_0^\bullet \otimes_{A_0} A_i)
\longrightarrow
\Hom_{K(A_0)}(E_0^\bullet, K_0^\bullet \otimes_{A_0} A)
$$
Since there are only a finite number of nonzero modules
$E_0^n$ and since these are all finitely presented modules, this
map is an isomorphism.

\medskip\noindent
In case (2) the object $E_0$ corresponds to a
bounded above complex $E_0^\bullet$ of finite free $A_0$-modules,
see Lemma \ref{lemma-pseudo-coherent-affine}.
We may represent $K_0$ by a finite complex $K_0^\bullet$
of flat $A_0$-modules, see Lemma \ref{lemma-tor-dimension-affine}
and
More on Algebra, Lemma \ref{more-algebra-lemma-tor-amplitude}.
In particular $K_0^\bullet$ is K-flat and we can argue as before
to arrive at the map
$$
\colim_{i \geq 0} \Hom_{K(A_0)}(E_0^\bullet,
K_0^\bullet \otimes_{A_0} A_i)
\longrightarrow
\Hom_{K(A_0)}(E_0^\bullet, K_0^\bullet \otimes_{A_0} A)
$$
It is clear that this map is an isomorphism (only a finite number of
terms are involved since $K_0^\bullet$ is bounded).
\end{proof}

\begin{lemma}
\label{lemma-descend-perfect}
In Situation \ref{situation-descent} the category of perfect
objects of $D(\mathcal{O}_S)$ is the colimit of the categories
of perfect objects of $D(\mathcal{O}_{S_i})$.
\end{lemma}

\begin{proof}
For every open $U_0 \subset S_0$ consider the condition $P$ that
the functor
$$
\colim_{i \geq 0} D_{perf}(\mathcal{O}_{U_i})
\longrightarrow
D_{perf}(\mathcal{O}_U)
$$
is an equivalence where ${}_{perf}$ indicates the full subcategory of
perfect objects and where $U = f_0^{-1}(U_0)$ and $U_i = f_{i0}^{-1}(U_0)$.
We will prove $P$ holds for all quasi-compact opens $U_0$
by the induction principle of
Cohomology of Schemes, Lemma \ref{coherent-lemma-induction-principle}.
First, we observe that we already know the functor is fully faithful
by Lemma \ref{lemma-descend-homomorphisms}. Thus it suffices to prove
essential surjectivity.

\medskip\noindent
We first check condition (2) of the induction principle. Thus suppose
that we have $S_0 = U_0 \cup V_0$ and that $P$ holds for
$U_0$, $V_0$, and $U_0 \cap V_0$. Let $E$ be a perfect object
of $D(\mathcal{O}_S)$. We can find $i \geq 0$ and $E_{U, i}$ perfect on $U_i$
and $E_{V, i}$ perfect on $V_i$ whose pullback to $U$ and $V$ are isomorphic
to $E|_U$ and $E|_V$. Denote
$$
a : E_{U, i} \to (Rf_{i, *}E)|_{U_i}
\quad\text{and}\quad
b : E_{V, i} \to (Rf_{i, *}E)|_{V_i}
$$
the maps adjoint to the isomorphisms $Lf_i^*E_{U, i} \to E|_U$
and $Lf_i^*E_{V, i} \to E|_V$.
By fully faithfulness, after increasing $i$,
we can find an isomorphism
$c : E_{U, i}|_{U_i \cap V_i} \to E_{V, i}|_{U_i \cap V_i}$
which pulls back to the identifications 
$$
Lf_i^*E_{U, i}|_{U \cap V} \to E|_{U \cap V} \to Lf_i^*E_{V, i}|_{U \cap V}.
$$
Apply Cohomology, Lemma \ref{cohomology-lemma-glue}
to get an object $E_i$ on $S_i$ and a map $d : E_i \to Rf_{i, *}E$
which restricts to the maps $a$ and $b$ over $U_i$ and $V_i$.
Then it is clear that $E_i$ is perfect and that
$d$ is adjoint to an isomorphism $Lf_i^*E_i \to E$.

\medskip\noindent
Finally, we check condition (1) of the induction principle, in other
words, we check the lemma holds when $S_0$ is affine.
Say $S_0 = \Spec(A_0)$, $S_i = \Spec(A_i)$, and
$S = \Spec(A)$. Using Lemmas \ref{lemma-affine-compare-bounded}
and \ref{lemma-perfect-affine} we see that we have to show that
$$
D_{perf}(A) = \colim D_{perf}(A_i)
$$
This is clear from the fact that perfect complexes over rings are
given by finite complexes of finite projective (hence finitely presented)
modules. See More on Algebra, Lemma
\ref{more-algebra-lemma-colimit-perfect-complexes} for details.
\end{proof}





\section{Cohomology and base change, VI}
\label{section-cohomology-and-base-change-final}

\noindent
A final section on cohomology and base change continuing
the discussion of Sections
\ref{section-cohomology-and-base-change-perfect},
\ref{section-cohomology-base-change}, and
\ref{section-producing-perfect}.
An easy to grok special case is given in
Remark \ref{remark-explain-perfect-direct-image}.

\begin{lemma}
\label{lemma-base-change-tensor-perfect}
Let $f : X \to S$ be a morphism of finite presentation.
Let $E \in D(\mathcal{O}_X)$ be a perfect object. Let $\mathcal{G}^\bullet$
be a bounded complex of finitely presented $\mathcal{O}_X$-modules,
flat over $S$, with support proper over $S$. Then
$$
K = Rf_*(E \otimes_{\mathcal{O}_X}^\mathbf{L} \mathcal{G}^\bullet)
$$
is a perfect object of $D(\mathcal{O}_S)$ and its formation
commutes with arbitrary base change.
\end{lemma}

\begin{proof}
The statement on base change is Lemma \ref{lemma-base-change-tensor}.
Thus it suffices to show that $K$ is a perfect object. If $S$ is
Noetherian, then this follows from
Lemma \ref{lemma-tensor-perfect}.
We will reduce to this case by Noetherian approximation.
We encourage the reader to skip the rest of this proof.

\medskip\noindent
The question is local on $S$, hence we may assume $S$ is affine.
Say $S = \Spec(R)$. We write $R = \colim R_i$ as a filtered colimit
of Noetherian rings $R_i$. By Limits, Lemma
\ref{limits-lemma-descend-finite-presentation}
there exists an $i$ and a scheme $X_i$ of finite presentation over $R_i$
whose base change to $R$ is $X$. By
Limits, Lemma \ref{limits-lemma-descend-modules-finite-presentation}
we may assume after increasing $i$, that there exists a bounded
complex of finitely presented $\mathcal{O}_{X_i}$-modules
$\mathcal{G}_i^\bullet$ whose pullback to $X$ is $\mathcal{G}^\bullet$.
After increasing $i$ we may assume $\mathcal{G}_i^n$ is flat over $R_i$, see
Limits, Lemma \ref{limits-lemma-descend-module-flat-finite-presentation}.
After increasing $i$ we may assume the support of $\mathcal{G}_i^n$
is proper over $R_i$, see
Limits, Lemma \ref{limits-lemma-eventually-proper-support}
and Cohomology of Schemes, Lemma
\ref{coherent-lemma-module-support-proper-over-base}.
Finally, by Lemma \ref{lemma-descend-perfect}
we may, after increasing $i$, assume there exists a perfect
object $E_i$ of $D(\mathcal{O}_{X_i})$ whose pullback to
$X$ is $E$. Applying Lemma \ref{lemma-tensor-perfect}
to $X_i \to \Spec(R_i)$, $E_i$, $\mathcal{G}_i^\bullet$ and using the
base change property already shown we obtain the result.
\end{proof}

\begin{remark}
\label{remark-explain-perfect-direct-image}
Let $R$ be a ring. Let $X$ be a scheme of finite presentation over
$R$. Let $\mathcal{G}$ be a finitely presented $\mathcal{O}_X$-module
flat over $R$ with support proper over $R$. By
Lemma \ref{lemma-base-change-tensor-perfect}
there exists a finite complex of finite projective $R$-modules
$M^\bullet$ such that we have
$$
R\Gamma(X_{R'}, \mathcal{G}_{R'}) = M^\bullet \otimes_R R'
$$
functorially in the $R$-algebra $R'$.
\end{remark}

\begin{lemma}
\label{lemma-base-change-tensor-pseudo-coherent}
Let $f : X \to S$ be a morphism of finite presentation.
Let $E \in D(\mathcal{O}_X)$ be a pseudo-coherent object.
Let $\mathcal{G}^\bullet$ be a bounded above complex of
finitely presented $\mathcal{O}_X$-modules, flat over $S$,
with support proper over $S$. Then
$$
K = Rf_*(E \otimes_{\mathcal{O}_X}^\mathbf{L} \mathcal{G}^\bullet)
$$
is a pseudo-coherent object of $D(\mathcal{O}_S)$ and its formation
commutes with arbitrary base change.
\end{lemma}

\begin{proof}
The statement on base change is Lemma \ref{lemma-base-change-tensor}.
Thus it suffices to show that $K$ is a pseudo-coherent object.
This will follow from Lemma \ref{lemma-base-change-tensor-perfect}
by approximation by perfect complexes. We encourage the reader to
skip the rest of the proof.

\medskip\noindent
The question is local on $S$, hence we may assume $S$ is affine.
Then $X$ is quasi-compact and quasi-separated. Moreover, there
exists an integer $N$ such that total direct image
$Rf_* : D_\QCoh(\mathcal{O}_X) \to D_\QCoh(\mathcal{O}_S)$
has cohomological dimension $N$ as explained in
Lemma \ref{lemma-quasi-coherence-direct-image}.
Choose an integer $b$ such that $\mathcal{G}^i = 0$ for $i > b$.
It suffices to show that $K$ is $m$-pseudo-coherent for
every $m$. Choose an approximation $P \to E$ by a perfect complex $P$
of $(X, E, m - N - 1 - b)$. This is possible by
Theorem \ref{theorem-approximation}.
Choose a distinguished triangle
$$
P \to E \to C \to P[1]
$$
in $D_\QCoh(\mathcal{O}_X)$. The cohomology sheaves of $C$ are zero
in degrees $\geq m - N - 1 - b$. Hence the cohomology sheaves of
$C \otimes^\mathbf{L} \mathcal{G}^\bullet$ are zero in degrees
$\geq m - N - 1$. Thus the cohomology sheaves of
$Rf_*(C \otimes^\mathbf{L} \mathcal{G}^\bullet)$
are zero in degrees $\geq m - 1$.
Hence
$$
Rf_*(P \otimes^\mathbf{L} \mathcal{G}^\bullet) \to
Rf_*(E \otimes^\mathbf{L} \mathcal{G}^\bullet)
$$
is an isomorphism on cohomology sheaves in degrees $\geq m$.
Next, suppose that $H^i(P) = 0$ for $i > a$. Then
$
P \otimes^\mathbf{L} \sigma_{\geq m - N - 1 - a}\mathcal{G}^\bullet
\longrightarrow
P \otimes^\mathbf{L} \mathcal{G}^\bullet
$
is an isomorphism on cohomology sheaves in degrees $\geq m - N - 1$.
Thus again we find that
$$
Rf_*(P \otimes^\mathbf{L} \sigma_{\geq m - N - 1 - a}\mathcal{G}^\bullet) \to
Rf_*(P \otimes^\mathbf{L} \mathcal{G}^\bullet)
$$
is an isomorphism on cohomology sheaves in degrees $\geq m$.
By Lemma \ref{lemma-base-change-tensor-perfect} the source
is a perfect complex.
We conclude that $K$ is $m$-pseudo-coherent as desired.
\end{proof}

\begin{lemma}
\label{lemma-flat-proper-perfect-direct-image-general}
Let $S$ be a scheme. Let $f : X \to S$ be a proper
morphism of finite presentation.
\begin{enumerate}
\item Let $E \in D(\mathcal{O}_X)$ be perfect and $f$ flat. Then
$Rf_*E$ is a perfect object of $D(\mathcal{O}_S)$ and its formation
commutes with arbitrary base change.
\item Let $\mathcal{G}$ be an $\mathcal{O}_X$-module of finite presentation,
flat over $S$. Then $Rf_*\mathcal{G}$ is a perfect object of
$D(\mathcal{O}_S)$ and its formation commutes with arbitrary base change.
\end{enumerate}
\end{lemma}

\begin{proof}
Special cases of
Lemma \ref{lemma-base-change-tensor-perfect} applied with
(1) $\mathcal{G}^\bullet$ equal to $\mathcal{O}_X$ in degree $0$
and (2) $E = \mathcal{O}_X$ and $\mathcal{G}^\bullet$ consisting
of $\mathcal{G}$ sitting in degree $0$.
\end{proof}

\begin{lemma}
\label{lemma-flat-proper-pseudo-coherent-direct-image-general}
Let $S$ be a scheme. Let $f : X \to S$ be a flat proper
morphism of finite presentation. Let $E \in D(\mathcal{O}_X)$
be pseudo-coherent. Then $Rf_*E$ is a pseudo-coherent object of
$D(\mathcal{O}_S)$ and its formation commutes with arbitrary base change.
\end{lemma}

\noindent
More generally, if $f : X \to S$ is proper and $E$ on $X$ is pseudo-coherent
relative to $S$ (More on Morphisms, Definition
\ref{more-morphisms-definition-relative-pseudo-coherence}),
then $Rf_*E$ is pseudo-coherent
(but formation does not commute with base change in this generality).
See \cite{Kiehl}.

\begin{proof}
Special case of
Lemma \ref{lemma-base-change-tensor-pseudo-coherent} applied with
$\mathcal{G}^\bullet$ equal to $\mathcal{O}_X$ in degree $0$.
\end{proof}

\begin{lemma}
\label{lemma-pullback-and-limits}
Let $R$ be a ring. Let $X$ be a scheme and let
$f : X \to \Spec(R)$ be proper, flat, and
of finite presentation. Let $(M_n)$ be an inverse
system of $R$-modules with surjective transition maps.
Then the canonical map
$$
\mathcal{O}_X \otimes_R (\lim M_n)
\longrightarrow
\lim \mathcal{O}_X \otimes_R M_n
$$
induces an isomorphism from the source to $DQ_X$ applied to the target.
\end{lemma}

\begin{proof}
The statement means that for any object $E$ of
$D_\QCoh(\mathcal{O}_X)$ the induced map
$$
\Hom(E, \mathcal{O}_X \otimes_R (\lim M_n))
\longrightarrow
\Hom(E, \lim \mathcal{O}_X \otimes_R M_n)
$$
is an isomorphism. Since $D_\QCoh(\mathcal{O}_X)$ has
a perfect generator (Theorem \ref{theorem-bondal-van-den-Bergh})
it suffices to check this for perfect $E$.
By Lemma \ref{lemma-Rlim-quasi-coherent} we have
$\lim \mathcal{O}_X \otimes_R M_n = R\lim \mathcal{O}_X \otimes_R M_n$.
The exact functor
$R\Hom_X(E, -) : D_\QCoh(\mathcal{O}_X) \to D(R)$
of Cohomology, Section \ref{cohomology-section-global-RHom}
commutes with products and hence with derived limits, whence
$$
R\Hom_X(E, \lim \mathcal{O}_X \otimes_R M_n) =
R\lim R\Hom_X(E, \mathcal{O}_X \otimes_R M_n)
$$
Let $E^\vee$ be the dual perfect complex, see
Cohomology, Lemma \ref{cohomology-lemma-dual-perfect-complex}.
We have
$$
R\Hom_X(E, \mathcal{O}_X \otimes_R M_n) =
R\Gamma(X, E^\vee \otimes_{\mathcal{O}_X}^\mathbf{L} Lf^*M_n) =
R\Gamma(X, E^\vee) \otimes_R^\mathbf{L} M_n
$$
by Lemma \ref{lemma-cohomology-base-change}.
From Lemma \ref{lemma-flat-proper-perfect-direct-image-general}
we see $R\Gamma(X, E^\vee)$ is a perfect complex of $R$-modules.
In particular it is a pseudo-coherent complex and by
More on Algebra, Lemma \ref{more-algebra-lemma-pseudo-coherent-tensor-limit}
we obtain
$$
R\lim R\Gamma(X, E^\vee) \otimes_R^\mathbf{L} M_n =
R\Gamma(X, E^\vee) \otimes_R^\mathbf{L} \lim M_n
$$
as desired.
\end{proof}

\begin{lemma}
\label{lemma-base-change-RHom-perfect}
Let $f : X \to S$ be a morphism of finite presentation.
Let $E \in D(\mathcal{O}_X)$ be a perfect object. Let $\mathcal{G}^\bullet$
be a bounded complex of finitely presented $\mathcal{O}_X$-modules,
flat over $S$, with support proper over $S$. Then
$$
K = Rf_*R\SheafHom(E, \mathcal{G}^\bullet)
$$
is a perfect object of $D(\mathcal{O}_S)$ and its formation
commutes with arbitrary base change.
\end{lemma}

\begin{proof}
The statement on base change is Lemma \ref{lemma-base-change-RHom}.
Thus it suffices to show that $K$ is a perfect object. If $S$ is
Noetherian, then this follows from
Lemma \ref{lemma-ext-perfect}.
We will reduce to this case by Noetherian approximation.
We encourage the reader to skip the rest of this proof.

\medskip\noindent
The question is local on $S$, hence we may assume $S$ is affine.
Say $S = \Spec(R)$. We write $R = \colim R_i$ as a filtered colimit
of Noetherian rings $R_i$. By Limits, Lemma
\ref{limits-lemma-descend-finite-presentation}
there exists an $i$ and a scheme $X_i$ of finite presentation over $R_i$
whose base change to $R$ is $X$. By
Limits, Lemma \ref{limits-lemma-descend-modules-finite-presentation}
we may assume after increasing $i$, that there exists a bounded complex
of finitely presented $\mathcal{O}_{X_i}$-modules $\mathcal{G}_i^\bullet$
whose pullback to $X$ is $\mathcal{G}^\bullet$. After increasing $i$
we may assume $\mathcal{G}_i^n$ is flat over $R_i$, see
Limits, Lemma \ref{limits-lemma-descend-module-flat-finite-presentation}.
After increasing $i$ we may assume the support of $\mathcal{G}_i^n$
is proper over $R_i$, see
Limits, Lemma \ref{limits-lemma-eventually-proper-support} and
Cohomology of Schemes, Lemma
\ref{coherent-lemma-module-support-proper-over-base}.
Finally, by Lemma \ref{lemma-descend-perfect}
we may, after increasing $i$, assume there exists a perfect
object $E_i$ of $D(\mathcal{O}_{X_i})$ whose pullback to
$X$ is $E$. Applying Lemma \ref{lemma-ext-perfect}
to $X_i \to \Spec(R_i)$, $E_i$, $\mathcal{G}_i^\bullet$ and using the
base change property already shown we obtain the result.
\end{proof}









\section{Perfect complexes}
\label{section-perfect-complexes}

\noindent
We first talk about jumping loci for betti numbers of perfect complexes.
Given a complex $E$ on a scheme $X$ and a point $x$ of $X$ we often write
$E \otimes_{\mathcal{O}_X}^\mathbf{L} \kappa(x)$ instead of the more correct
$Li_x^*E$, where $i_x : x \to X$ is the canonical morphism.

\begin{lemma}
\label{lemma-jump-loci}
Let $X$ be a scheme. Let $E \in D(\mathcal{O}_X)$ be pseudo-coherent
(for example perfect). For any $i \in \mathbf{Z}$ consider the function
$$
\beta_i : X \longrightarrow \{0, 1, 2, \ldots\},\quad
x \longmapsto
\dim_{\kappa(x)}
H^i(E \otimes_{\mathcal{O}_X}^\mathbf{L} \kappa(x))
$$
Then we have
\begin{enumerate}
\item formation of $\beta_i$ commutes with arbitrary base change,
\item the functions $\beta_i$ are upper semi-continuous, and
\item the level sets of $\beta_i$ are locally constructible in $X$.
\end{enumerate}
\end{lemma}

\begin{proof}
Consider a morphism of schemes $f : Y \to X$ and a point $y \in Y$.
Let $x$ be the image of $y$ and consider the commutative diagram
$$
\xymatrix{
y \ar[r]_j \ar[d]_g & Y \ar[d]^f \\
x \ar[r]^i & X
}
$$
Then we see that $Lg^* \circ Li^* = Lj^* \circ Lf^*$. This implies that
the function $\beta'_i$ associated to the pseudo-coherent complex $Lf^*E$
is the pullback of the function $\beta_i$, in a formula:
$\beta'_i = \beta_i \circ f$. This is the meaning of (1).

\medskip\noindent
Fix $i$ and let $x \in X$. It is enough to prove (2) and (3)
holds in an open neighbourhood of $x$, hence we may assume $X$ affine.
Then we can represent $E$ by a bounded above complex $\mathcal{F}^\bullet$
of finite free modules (Lemma \ref{lemma-lift-pseudo-coherent}).
Then $P = \sigma_{\geq i - 1}\mathcal{F}^\bullet$ is a perfect object
and $P \to E$ induces an isomorphism
$$
H^i(P \otimes_{\mathcal{O}_X}^\mathbf{L} \kappa(x')) \to
H^i(E \otimes_{\mathcal{O}_X}^\mathbf{L} \kappa(x'))
$$
for all $x' \in X$. Thus we may assume $E$ is perfect. In this case
by More on Algebra, Lemma
\ref{more-algebra-lemma-lift-perfect-from-residue-field}
there exists an affine open neighbourhood $U$ of $x$ and
$a \leq b$ such that $E|_U$ is represented by a complex
$$
\ldots \to 0 \to \mathcal{O}_U^{\oplus \beta_a(x)}
\to \mathcal{O}_U^{\oplus \beta_{a + 1}(x)} \to
\ldots \to
\mathcal{O}_U^{\oplus \beta_{b - 1}(x)} \to
\mathcal{O}_U^{\oplus \beta_b(x)} \to 0
\to \ldots
$$
(This also uses earlier results to turn the problem into algebra, for example
Lemmas \ref{lemma-affine-compare-bounded} and
\ref{lemma-perfect-affine}.)
It follows immediately that $\beta_i(x') \leq \beta_i(x)$
for all $x' \in U$. This proves that $\beta_i$ is upper
semi-continuous.

\medskip\noindent
To prove (3) we may assume that $X$ is affine and
$E$ is given by a complex of finite
free $\mathcal{O}_X$-modules (for example by arguing as in the previous
paragraph, or by using Cohomology, Lemma
\ref{cohomology-lemma-perfect-on-locally-ringed}).
Thus we have to show that given a complex
$$
\mathcal{O}_X^{\oplus a} \to
\mathcal{O}_X^{\oplus b} \to
\mathcal{O}_X^{\oplus c}
$$
the function associated to a point $x \in X$ the dimension of the cohomology
of $\kappa_x^{\oplus a} \to \kappa_x^{\oplus b} \to \kappa_x^{\oplus c}$
in the middle has constructible level sets. Let
$A \in \text{Mat}(a \times b, \Gamma(X, \mathcal{O}_X))$ be the matrix
of the first arrow. The rank of the image of $A$ in
$\text{Mat}(a \times b, \kappa(x))$ is equal to $r$ if all
$(r + 1) \times (r + 1)$-minors of $A$ vanish at $x$ and there is some
$r \times r$-minor of $A$ which does not vanish at $x$. Thus the set
of points where the rank is $r$ is a constructible locally closed set.
Arguing similarly for the second arrow and putting everything together
we obtain the desired result.
\end{proof}

\begin{lemma}
\label{lemma-chi-locally-constant}
Let $X$ be a scheme. Let $E \in D(\mathcal{O}_X)$ be perfect.
The function
$$
\chi_E : X \longrightarrow \mathbf{Z},\quad
x \longmapsto \sum (-1)^i
\dim_{\kappa(x)} H^i(E \otimes_{\mathcal{O}_X}^\mathbf{L} \kappa(x))
$$
is locally constant on $X$.
\end{lemma}

\begin{proof}
By Cohomology, Lemma
\ref{cohomology-lemma-perfect-on-locally-ringed}
we see that we can, locally on $X$, represent $E$ by a finite
complex $\mathcal{E}^\bullet$ of finite free $\mathcal{O}_X$-modules.
On such an open the function $\chi_E$ is constant with value
$\sum (-1)^i \text{rank}(\mathcal{E}^i)$.
\end{proof}

\begin{lemma}
\label{lemma-open-where-cohomology-in-degree-i-rank-r}
Let $X$ be a scheme. Let $E \in D(\mathcal{O}_X)$ be perfect.
Given $i, r \in \mathbf{Z}$, there exists an
open subscheme $U \subset X$ characterized by the following
\begin{enumerate}
\item $E|_U \cong H^i(E|_U)[-i]$ and $H^i(E|_U)$ is a locally free
$\mathcal{O}_U$-module of rank $r$,
\item a morphism $f : Y \to X$ factors through $U$ if and only if
$Lf^*E$ is isomorphic to a locally free module of rank $r$
placed in degree $i$.
\end{enumerate}
\end{lemma}

\begin{proof}
Let $\beta_j : X \to \{0, 1, 2, \ldots\}$ for $j \in \mathbf{Z}$
be the functions of Lemma \ref{lemma-jump-loci}. Then the set
$$
W = \{x \in X \mid \beta_j(x) \leq 0\text{ for all }j \not = i\}
$$
is open in $X$ and its formation commutes with pullback to any
$Y$ over $X$. This follows from the lemma using that
apriori in a neighbourhood of any point only a finite number
of the $\beta_j$ are nonzero. Thus we may replace $X$ by $W$
and assume that $\beta_j(x) = 0$ for all $x \in X$ and all $j \not = i$.
In this case $H^i(E)$ is a finite locally free module and
$E \cong H^i(E)[-i]$, see for example 
More on Algebra, Lemma
\ref{more-algebra-lemma-lift-perfect-from-residue-field}.
Thus $X$ is the disjoint union of the open subschemes where the
rank of $H^i(E)$ is fixed and we win.
\end{proof}

\begin{lemma}
\label{lemma-locally-closed-where-H0-locally-free}
Let $X$ be a scheme. Let $E \in D(\mathcal{O}_X)$ be perfect
of tor-amplitude in $[a, b]$ for some $a, b \in \mathbf{Z}$.
Let $r \geq 0$.
Then there exists a locally closed subscheme $j : Z \to X$
characterized by the following
\begin{enumerate}
\item $H^a(Lj^*E)$ is a locally free $\mathcal{O}_Z$-module of rank $r$, and
\item a morphism $f : Y \to X$ factors through $Z$
if and only if for all morphisms $g : Y' \to Y$ the
$\mathcal{O}_{Y'}$-module $H^a(L(f \circ g)^*E)$ is locally free
of rank $r$.
\end{enumerate}
Moreover, $j : Z \to X$ is of finite presentation and we have
\begin{enumerate}
\item[(3)] if $f : Y \to X$ factors as $Y \xrightarrow{g} Z \to X$, then
$H^a(Lf^*E) = g^*H^a(Lj^*E)$,
\item[(4)] if $\beta_a(x) \leq r$ for all $x \in X$, then
$j$ is a closed immersion and given $f : Y \to X$ the following
are equivalent
\begin{enumerate}
\item $f : Y \to X$ factors through $Z$,
\item $H^a(Lf^*E)$ is a locally free $\mathcal{O}_Y$-module of rank $r$,
\end{enumerate}
and if $r = 1$ these are also equivalent to
\begin{enumerate}
\item[(c)] $\mathcal{O}_Y \to \SheafHom_{\mathcal{O}_Y}(H^a(Lf^*E), H^a(Lf^*E))$
is injective.
\end{enumerate}
\end{enumerate}
\end{lemma}

\begin{proof}
First, let $U \subset X$ be the locally constructible
open subscheme where the function
$\beta_a$ of Lemma \ref{lemma-jump-loci} has values $\leq r$.
Let $f : Y \to X$ be as in (2). Then for any $y \in Y$
we have $\beta_a(Lf^*E) = r$ hence $y$ maps into $U$ by
Lemma \ref{lemma-jump-loci}. Hence $f$ as in (2) factors through $U$.
Thus we may replace $X$ by $U$ and assume that
$\beta_a(x) \in \{0, 1, \ldots, r\}$ for all $x \in X$.
We will show that in this case
there is a closed subscheme $Z \subset X$ cut out by a finite type
quasi-coherent ideal characterized
by the equivalence of (4) (a), (b) and (4)(c) if $r = 1$
and that (3) holds.
This will finish the proof because it will a fortiori show
that morphisms as in (2) factor through $Z$.

\medskip\noindent
If $x \in X$ and $\beta_a(x) < r$, then there is an
open neighbourhood of $x$ where $\beta_a < r$
(Lemma \ref{lemma-jump-loci}). In this way we
see that set theoretically at least $Z$ is a closed subset.

\medskip\noindent
To get a scheme theoretic structure, consider a point $x \in X$
with $\beta_a(x) = r$. Set $\beta = \beta_{a + 1}(x)$.
By More on Algebra, Lemma
\ref{more-algebra-lemma-lift-perfect-from-residue-field}
there exists an affine open neighbourhood $U$ of $x$
such that $K|_U$ is represented by a complex
$$
\ldots \to 0 \to \mathcal{O}_U^{\oplus r}
\xrightarrow{(f_{ij})} \mathcal{O}_U^{\oplus \beta} \to
\ldots \to
\mathcal{O}_U^{\oplus \beta_{b - 1}(x)} \to
\mathcal{O}_U^{\oplus \beta_b(x)} \to 0
\to \ldots
$$
(This also uses earlier results to turn the problem into algebra, for example
Lemmas \ref{lemma-affine-compare-bounded} and
\ref{lemma-perfect-affine}.) Now, if $g : Y \to U$ is any morphism
of schemes such that $g^\sharp(f_{ij})$ is nonzero for some pair $i, j$, then
$H^a(Lg^*E)$ is not a locally free $\mathcal{O}_Y$-module of rank $r$.
See More on Algebra, Lemma \ref{more-algebra-lemma-coker-injective-free}.
Trivially $H^a(Lg^*E)$ is a locally free $\mathcal{O}_Y$-module if
$g^\sharp(f_{ij}) = 0$ for all $i, j$. Thus we see that over $U$ the
closed subscheme cut out by all $f_{ij}$ satisfies
(3) and we have the equivalence of (4)(a) and (b).
The characterization of $Z$ shows that the locally constructed patches
glue (details omitted). Finally, if $r = 1$ then
(4)(c) is equivalent to (4)(b) because in this case locally
$H^a(Lg^*E) \subset \mathcal{O}_Y$ is the annihilator of the ideal generated
by the elements $g^\sharp(f_{ij})$.
\end{proof}





\section{Applications}
\label{section-applications}

\noindent
Mostly applications of cohomology and base change. In the future we may
generalize these results to the situation discussed in
Lemma \ref{lemma-base-change-tensor-perfect}.

\begin{lemma}
\label{lemma-jump-loci-geometric}
Let $f : X \to S$ be a proper morphism of finite presentation.
Let $\mathcal{F}$ be an $\mathcal{O}_X$-module of finite presentation,
flat over $S$. For fixed $i \in \mathbf{Z}$ consider the function
$$
\beta_i : S \to \{0, 1, 2, \ldots\},\quad
s \longmapsto \dim_{\kappa(s)} H^i(X_s, \mathcal{F}_s)
$$
Then we have
\begin{enumerate}
\item formation of $\beta_i$ commutes with arbitrary base change,
\item the functions $\beta_i$ are upper semi-continuous, and
\item the level sets of $\beta_i$ are locally constructible in $S$.
\end{enumerate}
\end{lemma}

\begin{proof}
By cohomology and base change (more precisely by
Lemma \ref{lemma-flat-proper-perfect-direct-image-general})
the object $K = Rf_*\mathcal{F}$ is a perfect object of the derived
category of $S$ whose formation commutes with arbitrary base change.
In particular we have
$$
H^i(X_s, \mathcal{F}_s) = H^i(K \otimes_{\mathcal{O}_S}^\mathbf{L} \kappa(s))
$$
Thus the lemma follows from
Lemma \ref{lemma-jump-loci}.
\end{proof}

\begin{lemma}
\label{lemma-chi-locally-constant-geometric}
Let $f : X \to S$ be a proper morphism of finite presentation.
Let $\mathcal{F}$ be an $\mathcal{O}_X$-module of finite presentation,
flat over $S$. The function
$$
s \longmapsto \chi(X_s, \mathcal{F}_s)
$$
is locally constant on $S$. Formation of this function commutes with
base change.
\end{lemma}

\begin{proof}
By cohomology and base change (more precisely by
Lemma \ref{lemma-flat-proper-perfect-direct-image-general})
the object $K = Rf_*\mathcal{F}$ is a perfect object of the derived
category of $S$ whose formation commutes with arbitrary base change.
Thus we have to show the map
$$
s \longmapsto \sum (-1)^i \dim_{\kappa(s)}
H^i(K \otimes^\mathbf{L}_{\mathcal{O}_S} \kappa(s))
$$
is locally constant on $S$. This is Lemma \ref{lemma-chi-locally-constant}.
\end{proof}

\begin{lemma}
\label{lemma-open-where-cohomology-in-degree-i-rank-r-geometric}
Let $f : X \to S$ be a proper morphism of finite presentation.
Let $\mathcal{F}$ be an $\mathcal{O}_X$-module of finite presentation,
flat over $S$. Fix $i, r \in \mathbf{Z}$.
Then there exists an open subscheme
$U \subset S$ with the following property:
A morphism $T \to S$ factors through $U$ if and only if
$Rf_{T, *}\mathcal{F}_T$ is isomorphic to a
finite locally free module of rank $r$ placed in degree $i$.
\end{lemma}

\begin{proof}
By cohomology and base change (more precisely by
Lemma \ref{lemma-flat-proper-perfect-direct-image-general})
the object $K = Rf_*\mathcal{F}$ is a perfect object of the derived
category of $S$ whose formation commutes with arbitrary base change.
Thus this lemma follows immediately from
Lemma \ref{lemma-open-where-cohomology-in-degree-i-rank-r}.
\end{proof}

\begin{lemma}
\label{lemma-vanishing-implies-locally-free}
Let $f : X \to S$ be a morphism of finite presentation.
Let $\mathcal{F}$ be an $\mathcal{O}_X$-module of finite presentation,
flat over $S$ with support proper over $S$. If $R^if_*\mathcal{F} = 0$
for $i > 0$, then $f_*\mathcal{F}$ is locally free and its formation
commutes with arbitrary base change (see proof for explanation).
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-base-change-tensor-perfect}
the object $E = Rf_*\mathcal{F}$ of $D(\mathcal{O}_S)$
is perfect and its formation commutes with arbitrary base change,
in the sense that $Rf'_*(g')^*\mathcal{F} = Lg^*E$
for any cartesian diagram
$$
\xymatrix{
X' \ar[r]_{g'} \ar[d]_{f'} &
X \ar[d]^f \\
S' \ar[r]^g &
S
}
$$
of schemes.
Since there is never any cohomology in degrees $< 0$, we see that
$E$ (locally) has tor-amplitude in $[0, b]$ for some $b$.
If $H^i(E) = R^if_*\mathcal{F} = 0$ for $i > 0$,
then $E$ has tor amplitude in $[0, 0]$. Whence
$E = H^0(E)[0]$. We conclude $H^0(E) = f_*\mathcal{F}$
is finite locally free by
More on Algebra, Lemma \ref{more-algebra-lemma-perfect}
(and the characterization of finite projective modules
in Algebra, Lemma \ref{algebra-lemma-finite-projective}).
Commutation with base change means that
$g^*f_*\mathcal{F} = f'_*(g')^*\mathcal{F}$ for
a diagram as above and it follows from the already
established commutation of base change for $E$.
\end{proof}

\begin{lemma}
\label{lemma-proper-flat-h0}
Let $f : X \to S$ be a morphism of schemes. Assume
\begin{enumerate}
\item $f$ is proper, flat, and of finite presentation, and
\item for all $s \in S$ we have $\kappa(s) = H^0(X_s, \mathcal{O}_{X_s})$.
\end{enumerate}
Then we have
\begin{enumerate}
\item[(a)] $f_*\mathcal{O}_X = \mathcal{O}_S$ and
this holds after any base change,
\item[(b)] locally on $S$ we have
$$
Rf_*\mathcal{O}_X = \mathcal{O}_S \oplus P
$$
in $D(\mathcal{O}_S)$
where $P$ is perfect of tor amplitude in $[1, \infty)$.
\end{enumerate}
\end{lemma}

\begin{proof}
By cohomology and base change
(Lemma \ref{lemma-flat-proper-perfect-direct-image-general})
the complex $E = Rf_*\mathcal{O}_X$
is perfect and its formation commutes with arbitrary base change.
This first implies that $E$ has tor amplitude in $[0, \infty)$.
Second, it implies that for $s \in S$ we have
$H^0(E \otimes^\mathbf{L} \kappa(s)) =
H^0(X_s, \mathcal{O}_{X_s}) = \kappa(s)$.
It follows that the map $\mathcal{O}_S \to Rf_*\mathcal{O}_X = E$
induces an isomorphism
$\mathcal{O}_S \otimes \kappa(s) \to H^0(E \otimes^\mathbf{L} \kappa(s))$.
Hence $H^0(E) \otimes \kappa(s) \to H^0(E \otimes^\mathbf{L} \kappa(s))$
is surjective and we may apply
More on Algebra, Lemma \ref{more-algebra-lemma-better-cut-complex-in-two}
to see that, after replacing $S$ by an affine open neighbourhood of $s$,
we have a decomposition $E = H^0(E) \oplus \tau_{\geq 1}E$
with $\tau_{\geq 1}E$ perfect of tor amplitude in $[1, \infty)$.
Since $E$ has tor amplitude in $[0, \infty)$ we find that
$H^0(E)$ is a flat $\mathcal{O}_S$-module.
It follows that $H^0(E)$ is a flat, perfect $\mathcal{O}_S$-module,
hence finite locally free, see
More on Algebra, Lemma \ref{more-algebra-lemma-perfect}
(and the fact that finite projective modules are finite locally free by
Algebra, Lemma \ref{algebra-lemma-finite-projective}).
It follows that the map $\mathcal{O}_S \to H^0(E)$ is
an isomorphism as we can check this after tensoring with
residue fields (Algebra, Lemma \ref{algebra-lemma-cokernel-flat}).
\end{proof}

\begin{lemma}
\label{lemma-proper-flat-geom-red-connected}
Let $f : X \to S$ be a morphism of schemes. Assume
\begin{enumerate}
\item $f$ is proper, flat, and of finite presentation, and
\item the geometric fibres of $f$ are reduced and connected.
\end{enumerate}
Then $f_*\mathcal{O}_X = \mathcal{O}_S$ and this holds
after any base change.
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-proper-flat-h0}
it suffices to show that $\kappa(s) = H^0(X_s, \mathcal{O}_{X_s})$
for all $s \in S$. This follows from
Varieties, Lemma
\ref{varieties-lemma-proper-geometrically-reduced-global-sections}
and the fact that $X_s$ is geometrically connected and geometrically reduced.
\end{proof}

\begin{lemma}
\label{lemma-proper-idempotent-on-fibre}
Let $f : X \to S$ be a proper morphism of schemes. Let $s \in S$
and let $e \in H^0(X_s, \mathcal{O}_{X_s})$ be an idempotent.
Then $e$ is in the image of the map
$(f_*\mathcal{O}_X)_s \to H^0(X_s, \mathcal{O}_{X_s})$.
\end{lemma}

\begin{proof}
Let $X_s = T_1 \amalg T_2$ be the disjoint union decomposition
with $T_1$ and $T_2$ nonempty and open and closed in $X_s$
corresponding to $e$, i.e., such that $e$ is identitically $1$
on $T_1$ and identically $0$ on $T_2$.

\medskip\noindent
Assume $S$ is Noetherian. We will use the theorem on formal functions
in the form of Cohomology of Schemes, Lemma
\ref{coherent-lemma-formal-functions-stalk}.
It tells us that
$$
(f_*\mathcal{O}_X)_s^\wedge = \lim_n H^0(X_n, \mathcal{O}_{X_n})
$$
where $X_n$ is the $n$th infinitesimal neighbourhood of $X_s$.
Since the underlying topological space of $X_n$ is equal to that
of $X_s$ we obtain for all $n $ a disjoint union decomposition of schemes
$X_n = T_{1, n} \amalg T_{2, n}$ where the underlying topological space
of $T_{i, n}$ is $T_i$ for $i = 1, 2$. This means
$H^0(X_n, \mathcal{O}_{X_n})$ contains a nontrivial idempotent $e_n$,
namely the function which is identically $1$ on $T_{1, n}$ and
identically $0$ on $T_{2, n}$. It is clear that $e_{n + 1}$
restricts to $e_n$ on $X_n$. Hence $e_\infty = \lim e_n$
is a nontrivial idempotent of the limit. Thus $e_\infty$
is an element of the completion of $(f_*\mathcal{O}_X)_s$
mapping to $e$ in $H^0(X_s, \mathcal{O}_{X_s})$.
Since the map $(f_*\mathcal{O}_X)_s^\wedge \to H^0(X_s, \mathcal{O}_{X_s})$
factors through
$(f_*\mathcal{O}_X)^\wedge_s / \mathfrak m_s (f_*\mathcal{O}_X)_s^\wedge =
(f_*\mathcal{O}_X)_s / \mathfrak m_s (f_*\mathcal{O}_X)_s$
(Algebra, Lemma \ref{algebra-lemma-hathat-finitely-generated})
we conclude that $e$ is in the image of the
map $(f_*\mathcal{O}_X)_s \to H^0(X_s, \mathcal{O}_{X_s})$
as desired.

\medskip\noindent
General case: we reduce the general case to the Noetherian case by
limit arguments. We urge the reader to skip the proof.
We may replace $S$ by an affine open neighbourhood of $s$.
Thus we may and do assume that $S$ is affine. By Limits, Lemma
\ref{limits-lemma-proper-limit-of-proper-finite-presentation-noetherian}
we can write $(f : X \to S) = \lim (f_i : X_i \to S_i)$ with $f_i$
proper and $S_i$ Noetherian. Denote $s_i \in S_i$ the image of $s$.
Then $s = \lim s_i$, see
Limits, Lemma \ref{limits-lemma-inverse-limit-irreducibles}.
Then $X_s = X \times_S s = \lim X_i \times_{S_i} s_i = \lim X_{i, s_i}$
because limits commute with limits
(Categories, Lemma \ref{categories-lemma-colimits-commute}).
Hence $e$ is the image of some idempotent
$e_i \in H^0(X_{i, s_i}, \mathcal{O}_{X_{i, s_i}})$
by Limits, Lemma \ref{limits-lemma-descend-section}.
By the Noetherian case there is an element $\tilde e_i$
in the stalk $(f_{i, *}\mathcal{O}_{X_i})_{s_i}$ mapping
to $e_i$. Taking the pullback of $\tilde e_i$ we get an
element $\tilde e$ of $(f_*\mathcal{O}_X)_s$ mapping
to $e$ and the proof is complete.
\end{proof}

\begin{lemma}
\label{lemma-proper-flat-geom-red}
Let $f : X \to S$ be a morphism of schemes. Let $s \in S$. Assume
\begin{enumerate}
\item $f$ is proper, flat, and of finite presentation, and
\item the fibre $X_s$ is geometrically reduced.
\end{enumerate}
Then, after replacing $S$ by an open neighbourhood of $s$, there
exists a direct sum decomposition
$Rf_*\mathcal{O}_X = f_*\mathcal{O}_X \oplus P$
in $D(\mathcal{O}_S)$ where $f_*\mathcal{O}_X$ is a finite \'etale
$\mathcal{O}_S$-algebra and
$P$ is a perfect of tor amplitude in $[1, \infty)$.
\end{lemma}

\begin{proof}
The proof of this lemma is similar to the proof of
Lemma \ref{lemma-proper-flat-h0}
which we suggest the reader read first.
By cohomology and base change
(Lemma \ref{lemma-flat-proper-perfect-direct-image-general})
the complex $E = Rf_*\mathcal{O}_X$
is perfect and its formation commutes with arbitrary base change.
This first implies that $E$ has tor amplitude in $[0, \infty)$.

\medskip\noindent
We claim that after replacing $S$ by an open neighbourhood of
$s$ we can find a direct sum decomposition
$E = H^0(E) \oplus \tau_{\geq 1}E$ in $D(\mathcal{O}_S)$
with $\tau_{\geq 1}E$ of tor amplitude in $[1, \infty)$.
Assume the claim is true for now and assume we've made the replacement
so we have the direct sum decomposition.
Since $E$ has tor amplitude in $[0, \infty)$ we find that
$H^0(E)$ is a flat $\mathcal{O}_S$-module.
Hence $H^0(E)$ is a flat, perfect $\mathcal{O}_S$-module,
hence finite locally free, see
More on Algebra, Lemma \ref{more-algebra-lemma-perfect}
(and the fact that finite projective modules are finite locally free by
Algebra, Lemma \ref{algebra-lemma-finite-projective}).
Of course $H^0(E) = f_*\mathcal{O}_X$ is an $\mathcal{O}_S$-algebra.
By cohomology and base change we obtain
$H^0(E) \otimes \kappa(s) = H^0(X_s, \mathcal{O}_{X_s})$.
By Varieties, Lemma
\ref{varieties-lemma-proper-geometrically-reduced-global-sections}
and the assumption that $X_s$ is geometrically reduced, we
see that $\kappa(s) \to H^0(E) \otimes \kappa(s)$
is finite \'etale. By Morphisms, Lemma
\ref{morphisms-lemma-set-points-where-fibres-etale}
applied to the finite locally free morphism
$\underline{\Spec}_S(H^0(E)) \to S$,
we conclude that after shrinking $S$ the $\mathcal{O}_S$-algebra
$H^0(E)$ is finite \'etale.

\medskip\noindent
It remains to prove the claim. For this it suffices to prove that the map
$$
(f_*\mathcal{O}_X)_s
\longrightarrow
H^0(X_s, \mathcal{O}_{X_s}) = H^0(E \otimes^\mathbf{L} \kappa(s))
$$
is surjective, see
More on Algebra, Lemma \ref{more-algebra-lemma-better-cut-complex-in-two}.
Choose a flat local ring homomorphism $\mathcal{O}_{S, s} \to A$
such that the residue field $k$ of $A$ is algebraically closed, see
Algebra, Lemma \ref{algebra-lemma-flat-local-given-residue-field}.
By flat base change (Cohomology of Schemes, Lemma
\ref{coherent-lemma-flat-base-change-cohomology})
we get $H^0(X_A, \mathcal{O}_{X_A}) =
(f_*\mathcal{O}_X)_s \otimes_{\mathcal{O}_{S, s}} A$
and $H^0(X_k, \mathcal{O}_{X_k}) =
H^0(X_s, \mathcal{O}_{X_s}) \otimes_{\kappa(s)} k$.
Hence it suffices to prove that
$H^0(X_A, \mathcal{O}_{X_A}) \to H^0(X_k, \mathcal{O}_{X_k})$
is surjective. Since $X_k$ is a reduced proper scheme over $k$
and since $k$ is algebraically closed, we see that
$H^0(X_k, \mathcal{O}_{X_k})$ is a finite product of copies
of $k$ by the already used Varieties, Lemma
\ref{varieties-lemma-proper-geometrically-reduced-global-sections}.
Since by Lemma \ref{lemma-proper-idempotent-on-fibre}
the idempotents of this $k$-algebra are in the image
of $H^0(X_A, \mathcal{O}_{X_A}) \to H^0(X_k, \mathcal{O}_{X_k})$ we conclude.
\end{proof}





\section{Other applications}
\label{section-other-applications}

\noindent
In this section we state and prove some results that can be deduced
from the theory worked out above.

\begin{lemma}
\label{lemma-cohomology-over-coherent-ring}
Let $R$ be a coherent ring. Let $X$ be a scheme of finite presentation over $R$.
Let $\mathcal{G}$ be an $\mathcal{O}_X$-module of finite presentation,
flat over $R$, with support proper over $R$. Then
$H^i(X, \mathcal{G})$ is a coherent $R$-module.
\end{lemma}

\begin{proof}
Combine Lemma \ref{lemma-base-change-tensor-perfect} with
More on Algebra, Lemmas \ref{more-algebra-lemma-coherent-pseudo-coherent} and
\ref{more-algebra-lemma-perfect}.
\end{proof}

\begin{lemma}
\label{lemma-countable-cohomology}
Let $X$ be a quasi-compact and quasi-separated scheme.
Let $K$ be an object of $D_\QCoh(\mathcal{O}_X)$
such that the cohomology sheaves $H^i(K)$ have countable
sets of sections over affine opens. Then for any quasi-compact open
$U \subset X$ and any perfect object $E$ in $D(\mathcal{O}_X)$
the sets
$$
H^i(U, K \otimes^\mathbf{L} E),\quad \Ext^i(E|_U, K|_U)
$$
are countable.
\end{lemma}

\begin{proof}
Using Cohomology, Lemma \ref{cohomology-lemma-dual-perfect-complex}
we see that it suffices to prove the result
for the groups $H^i(U, K \otimes^\mathbf{L} E)$.
We will use the induction principle to prove the lemma, see
Cohomology of Schemes, Lemma \ref{coherent-lemma-induction-principle}.

\medskip\noindent
First we show that it holds when $U = \Spec(A)$ is affine. Namely, we can
represent $K$ by a complex of $A$-modules $K^\bullet$ and $E$ by a
finite complex of finite projective $A$-modules $P^\bullet$.
See Lemmas \ref{lemma-affine-compare-bounded} and
\ref{lemma-perfect-affine}
and our definition of perfect complexes of $A$-modules
(More on Algebra, Definition \ref{more-algebra-definition-perfect}).
Then $(E \otimes^\mathbf{L} K)|_U$ is represented by
the total complex associated to the double complex
$P^\bullet \otimes_A K^\bullet$
(Lemma \ref{lemma-quasi-coherence-tensor-product}).
Using induction on the length of the complex
$P^\bullet$ (or using a suitable spectral sequence)
we see that it suffices to show that
$H^i(P^a \otimes_A K^\bullet)$ is countable for each $a$.
Since $P^a$ is a direct summand of $A^{\oplus n}$ for
some $n$ this follows from the assumption that
the cohomology group $H^i(K^\bullet)$ is countable.

\medskip\noindent
To finish the proof it suffices to show: if $U = V \cup W$
and the result holds for $V$, $W$, and $V \cap W$, then
the result holds for $U$. This is an immediate consequence
of the Mayer-Vietoris sequence, see
Cohomology, Lemma \ref{cohomology-lemma-unbounded-mayer-vietoris}.
\end{proof}

\begin{lemma}
\label{lemma-countable}
Let $X$ be a quasi-compact and quasi-separated scheme such that
the sets of sections of $\mathcal{O}_X$ over affine opens are countable.
Let $K$ be an object of $D_\QCoh(\mathcal{O}_X)$. The
following are equivalent
\begin{enumerate}
\item $K = \text{hocolim} E_n$ with $E_n$ a perfect object of
$D(\mathcal{O}_X)$, and
\item the cohomology sheaves $H^i(K)$ have countable
sets of sections over affine opens.
\end{enumerate}
\end{lemma}

\begin{proof}
If (1) is true, then (2) is true because homotopy colimits commutes
with taking cohomology sheaves
(by Derived Categories, Lemma \ref{derived-lemma-cohomology-of-hocolim})
and because a perfect complex is
locally isomorphic to a finite complex of finite free $\mathcal{O}_X$-modules
and therefore satisfies (2) by assumption on $X$.

\medskip\noindent
Assume (2).
Choose a K-injective complex $\mathcal{K}^\bullet$ representing $K$.
Choose a perfect generator $E$ of $D_\QCoh(\mathcal{O}_X)$ and
represent it by a K-injective complex $\mathcal{I}^\bullet$.
According to Theorem \ref{theorem-DQCoh-is-Ddga}
and its proof there is an equivalence
of triangulated categories $F : D_\QCoh(\mathcal{O}_X) \to D(A, \text{d})$
where $(A, \text{d})$ is the differential graded algebra
$$
(A, \text{d}) =
\Hom_{\text{Comp}^{dg}(\mathcal{O}_X)}
(\mathcal{I}^\bullet, \mathcal{I}^\bullet)
$$
which maps $K$ to the differential graded module
$$
M = \Hom_{\text{Comp}^{dg}(\mathcal{O}_X)}
(\mathcal{I}^\bullet, \mathcal{K}^\bullet)
$$
Note that $H^i(A) = \Ext^i(E, E)$ and
$H^i(M) = \Ext^i(E, K)$.
Moreover, since $F$ is an equivalence it and its quasi-inverse commute
with homotopy colimits.
Therefore, it suffices to write $M$ as a homotopy colimit
of compact objects of $D(A, \text{d})$.
By Differential Graded Algebra, Lemma \ref{dga-lemma-countable}
it suffices show that $\Ext^i(E, E)$ and
$\Ext^i(E, K)$ are countable for each $i$.
This follows from Lemma \ref{lemma-countable-cohomology}.
\end{proof}

\begin{lemma}
\label{lemma-computing-sections-as-colim}
Let $A$ be a ring. Let $X$ be a scheme of finite presentation over $A$.
Let $f : U \to X$ be a flat morphism of finite presentation. Then
\begin{enumerate}
\item there exists an inverse system of perfect objects $L_n$ of
$D(\mathcal{O}_X)$ such that
$$
R\Gamma(U, Lf^*K) = \text{hocolim}\ R\Hom_X(L_n, K)
$$
in $D(A)$ functorially in $K$ in $D_\QCoh(\mathcal{O}_X)$, and
\item there exists a system of perfect objects $E_n$ of
$D(\mathcal{O}_X)$ such that
$$
R\Gamma(U, Lf^*K) = \text{hocolim}\ R\Gamma(X, E_n \otimes^\mathbf{L} K)
$$
in $D(A)$ functorially in $K$ in $D_\QCoh(\mathcal{O}_X)$.
\end{enumerate}
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-cohomology-base-change} we have
$$
R\Gamma(U, Lf^*K) = R\Gamma(X, Rf_*\mathcal{O}_U \otimes^\mathbf{L} K)
$$
functorially in $K$. Observe that $R\Gamma(X, -)$ commutes with
homotopy colimits because it commutes with direct sums by
Lemma \ref{lemma-quasi-coherence-pushforward-direct-sums}.
Similarly, $- \otimes^\mathbf{L} K$ commutes with derived colimits
because $- \otimes^\mathbf{L} K$ commutes with direct sums
(because direct sums in $D(\mathcal{O}_X)$
are given by direct sums of representing complexes).
Hence to prove (2) it suffices to write
$Rf_*\mathcal{O}_U = \text{hocolim} E_n$ for a system of
perfect objects $E_n$ of $D(\mathcal{O}_X)$. Once this is done
we obtain (1) by setting $L_n = E_n^\vee$, see
Cohomology, Lemma \ref{cohomology-lemma-dual-perfect-complex}.

\medskip\noindent
Write $A = \colim A_i$ with $A_i$ of finite type over $\mathbf{Z}$.
By Limits, Lemma \ref{limits-lemma-descend-finite-presentation}
we can find an $i$ and morphisms $U_i \to X_i \to \Spec(A_i)$
of finite presentation whose base change to $\Spec(A)$ recovers
$U \to X \to \Spec(A)$.
After increasing $i$ we may assume that $f_i : U_i \to X_i$ is
flat, see Limits, Lemma \ref{limits-lemma-descend-flat-finite-presentation}.
By Lemma \ref{lemma-compare-base-change}
the derived pullback of $Rf_{i, *}\mathcal{O}_{U_i}$
by $g : X \to X_i$ is equal to $Rf_*\mathcal{O}_U$.
Since $Lg^*$ commutes with derived colimits, it suffices
to prove what we want for $f_i$. Hence we may assume that
$U$ and $X$ are of finite type over $\mathbf{Z}$.

\medskip\noindent
Assume $f : U \to X$ is a morphism of schemes of finite type over $\mathbf{Z}$.
To finish the proof we will show that $Rf_*\mathcal{O}_U$ is a homotopy
colimit of perfect complexes. To see this we apply Lemma \ref{lemma-countable}.
Thus it suffices to show that $R^if_*\mathcal{O}_U$
has countable sets of sections over affine opens.
This follows from Lemma \ref{lemma-countable-cohomology}
applied to the structure sheaf.
\end{proof}




\section{Characterizing pseudo-coherent complexes, II}
\label{section-pseudo-coherent}

\noindent
This section is a continuation of
Section \ref{section-pseudo-coherent-hocolim}.
In this section we discuss characterizations of pseudo-coherent complexes
in terms of cohomology. More results of this nature can be found in
More on Morphisms, Section
\ref{more-morphisms-section-characterize-pseudo-coherent}.

\begin{lemma}
\label{lemma-pseudo-coherent-over-algebra}
Let $A$ be a ring. Let $R$ be a (possibly noncommutative) $A$-algebra
which is finite free as an $A$-module. Then any object $M$ of $D(R)$
which is pseudo-coherent in $D(A)$ can be represented by a
bounded above complex of finite free (right) $R$-modules.
\end{lemma}

\begin{proof}
Choose a complex $M^\bullet$ of right $R$-modules representing $M$.
Since $M$ is pseudo-coherent we have $H^i(M) = 0$ for large enough $i$.
Let $m$ be the smallest index such that $H^m(M)$ is nonzero.
Then $H^m(M)$ is a finite $A$-module by
More on Algebra, Lemma \ref{more-algebra-lemma-finite-cohomology}.
Thus we can choose a finite free $R$-module $F^m$ and a map
$F^m \to M^m$ such that $F^m \to M^m \to M^{m + 1}$ is zero
and such that $F^m \to H^m(M)$ is surjective.
Picture:
$$
\xymatrix{
& F^m \ar[d]^\alpha \ar[r] & 0 \ar[d] \ar[r] & \ldots \\
M^{m - 1} \ar[r] & M^m \ar[r] & M^{m + 1} \ar[r] & \ldots
}
$$
By descending induction on $n \leq m$ we are going to construct
finite free $R$-modules $F^i$ for $i \geq n$, differentials
$d^i : F^i \to F^{i + 1}$ for $i \geq n$, maps $\alpha : F^i \to K^i$
compatible with differentials, such that
(1) $H^i(\alpha)$ is an isomorphism for $i > n$ and surjective for $i = n$, and
(2) $F^i = 0$ for $i > m$. Picture
$$
\xymatrix{
& F^n \ar[r] \ar[d]^\alpha & F^{n + 1} \ar[d]^\alpha \ar[r] & \ldots \ar[r]
& F^i \ar[d]^\alpha \ar[r] & 0 \ar[d] \ar[r] & \ldots \\
M^{n - 1} \ar[r] & M^n \ar[r] & M^{n + 1} \ar[r] & \ldots \ar[r] &
M^i \ar[r] & M^{i + 1} \ar[r] & \ldots
}
$$
The base case is $n = m$ which we've done above.
Induction step. Let $C^\bullet$ be the cone on $\alpha$
(Derived Categories, Definition \ref{derived-definition-cone}).
The long exact sequence
of cohomology shows that $H^i(C^\bullet) = 0$ for $i \geq n$.
Observe that $F^\bullet$ is pseudo-coherent as a complex of $A$-modules
because $R$ is finite free as an $A$-module. Hence
by More on Algebra, Lemma \ref{more-algebra-lemma-cone-pseudo-coherent}
we see that $C^\bullet$ is $(n - 1)$-pseudo-coherent as a complex of
$A$-modules. By
More on Algebra, Lemma \ref{more-algebra-lemma-finite-cohomology}
we see that $H^{n - 1}(C^\bullet)$ is a finite $A$-module.
Choose a finite free $R$-module $F^{n - 1}$ and a map
$\beta : F^{n - 1} \to C^{n - 1}$ such that the composition
$F^{n - 1} \to C^{n - 1} \to C^n$ is zero and such that $F^{n - 1}$
surjects onto $H^{n - 1}(C^\bullet)$. Since
$C^{n - 1} = M^{n - 1} \oplus F^n$
we can write $\beta = (\alpha^{n - 1}, -d^{n - 1})$. The vanishing of the
composition $F^{n - 1} \to C^{n - 1} \to C^n$ implies
these maps fit into a morphism of complexes
$$
\xymatrix{
& F^{n - 1} \ar[d]^{\alpha^{n - 1}} \ar[r]_{d^{n - 1}} &
F^n \ar[r] \ar[d]^\alpha &
F^{n + 1} \ar[d]^\alpha \ar[r] & \ldots \\
\ldots \ar[r] &
M^{n - 1} \ar[r] & M^n \ar[r] & M^{n + 1} \ar[r] & \ldots
}
$$
Moreover, these maps define a morphism of distinguished triangles
$$
\xymatrix{
(F^n \to \ldots) \ar[r] \ar[d] &
(F^{n - 1} \to \ldots) \ar[r] \ar[d] &
F^{n - 1} \ar[r] \ar[d]_\beta &
(F^n \to \ldots)[1] \ar[d] \\
(F^n \to \ldots) \ar[r] &
M^\bullet \ar[r] &
C^\bullet \ar[r] &
(F^n \to \ldots)[1]
}
$$
Hence our choice of $\beta$ implies that the map of complexes
$(F^{n - 1} \to \ldots) \to M^\bullet$ induces an isomorphism on
cohomology in degrees $\geq n$ and a surjection in degree $n - 1$.
This finishes the proof of the lemma.
\end{proof}

\begin{lemma}
\label{lemma-pseudo-coherent-on-projective-space}
Let $A$ be a ring. Let $n \geq 0$. Let
$K \in D_\QCoh(\mathcal{O}_{\mathbf{P}^n_A})$.
The following are equivalent
\begin{enumerate}
\item $K$ is pseudo-coherent,
\item $R\Gamma(\mathbf{P}^n_A, E \otimes^\mathbf{L} K)$ is a pseudo-coherent
object of $D(A)$ for each pseudo-coherent object $E$ of
$D(\mathcal{O}_{\mathbf{P}^n_A})$,
\item $R\Gamma(\mathbf{P}^n_A, E \otimes^\mathbf{L} K)$ is a pseudo-coherent
object of $D(A)$ for each perfect object $E$ of
$D(\mathcal{O}_{\mathbf{P}^n_A})$,
\item $R\Hom_{\mathbf{P}^n_A}(E, K)$ is a pseudo-coherent
object of $D(A)$ for each perfect object $E$ of
$D(\mathcal{O}_{\mathbf{P}^n_A})$,
\item $R\Gamma(\mathbf{P}^n_A,
K \otimes^\mathbf{L} \mathcal{O}_{\mathbf{P}^n_A}(d))$ is pseudo-coherent
object of $D(A)$ for $d = 0, 1, \ldots, n$.
\end{enumerate}
\end{lemma}

\begin{proof}
Recall that
$$
R\Hom_{\mathbf{P}^n_A}(E, K) =
R\Gamma(\mathbf{P}^n_A, R\SheafHom_{\mathcal{O}_{\mathbf{P}^n_A}}(E, K))
$$
by definition, see Cohomology, Section \ref{cohomology-section-global-RHom}.
Thus parts (4) and (3) are equivalent by
Cohomology, Lemma \ref{cohomology-lemma-dual-perfect-complex}.

\medskip\noindent
Since every perfect complex is pseudo-coherent, it is clear that
(2) implies (3).

\medskip\noindent
Assume (1) holds. Then $E \otimes^\mathbf{L} K$ is pseudo-coherent
for every pseudo-coherent $E$, see
Cohomology, Lemma \ref{cohomology-lemma-tensor-pseudo-coherent}.
By Lemma \ref{lemma-flat-proper-pseudo-coherent-direct-image-general}
the direct image of such a pseudo-coherent complex is pseudo-coherent
and we see that (2) is true.

\medskip\noindent
Part (3) implies (5) because we can take $E = \mathcal{O}_{\mathbf{P}^n_A}(d)$
for $d = 0, 1, \ldots, n$.

\medskip\noindent
To finish the proof we have to show that (5) implies (1).
Let $P$ be as in (\ref{equation-generator-Pn}) and
$R$ as in (\ref{equation-algebra-for-Pn}).
By Lemma \ref{lemma-Pn-module-category} we have an equivalence
$$
- \otimes^\mathbf{L}_R P :
D(R) \longrightarrow D_\QCoh(\mathcal{O}_{\mathbf{P}^n_A})
$$
Let $M \in D(R)$ be an object such that $M \otimes^\mathbf{L} P = K$.
By Differential Graded Algebra, Lemma
\ref{dga-lemma-upgrade-tensor-with-complex-derived}
there is an isomorphism
$$
R\Hom(R, M) = R\Hom_{\mathbf{P}^n_A}(P, K)
$$
in $D(A)$. Arguing as above we obtain
$$
R\Hom_{\mathbf{P}^n_A}(P, K) = R\Gamma(\mathbf{P}^n_A,
R\SheafHom_{\mathcal{O}_{\mathbf{P}^n_A}}(E, K)) =
R\Gamma(\mathbf{P}^n_A,
P^\vee \otimes^\mathbf{L}_{\mathcal{O}_{\mathbf{P}^n_A}} K).
$$
Using that $P^\vee$ is the direct sum of
$\mathcal{O}_{\mathbf{P}^n_A}(d)$ for $d = 0, 1, \ldots, n$
and (5) we conclude $R\Hom(R, M)$ is pseudo-coherent as a complex
of $A$-modules. Of course $M = R\Hom(R, M)$ in $D(A)$.
Thus $M$ is pseudo-coherent as a complex of $A$-modules.
By Lemma \ref{lemma-pseudo-coherent-over-algebra}
we may represent $M$ by a bounded above complex $F^\bullet$
of finite free $R$-modules. Then
$F^\bullet = \bigcup_{p \geq 0} \sigma_{\geq p}F^\bullet$
is a filtration which shows that $F^\bullet$ is a differential
graded $R$-module with property (P), see
Differential Graded Algebra, Section \ref{dga-section-P-resolutions}.
Hence $K = M \otimes^\mathbf{L}_R P$ is represented
by $F^\bullet \otimes_R P$ (follows from the construction of the
derived tensor functor, see for example the proof of
Differential Graded Algebra, Lemma \ref{dga-lemma-tensor-with-complex-derived}).
Since $F^\bullet \otimes_R P$
is a bounded above complex whose terms are direct sums of
copies of $P$ we conclude that the lemma is true.
\end{proof}

\begin{lemma}
\label{lemma-perfect-enough}
Let $A$ be a ring. Let $X$ be a scheme over $A$ which is quasi-compact
and quasi-separated. Let $K \in D^-_\QCoh(\mathcal{O}_X)$.
If $R\Gamma(X, E \otimes^\mathbf{L} K)$ is pseudo-coherent
in $D(A)$ for every perfect $E$ in $D(\mathcal{O}_X)$,
then $R\Gamma(X, E \otimes^\mathbf{L} K)$ is pseudo-coherent
in $D(A)$ for every pseudo-coherent $E$ in $D(\mathcal{O}_X)$.
\end{lemma}

\begin{proof}
There exists an integer $N$ such that
$R\Gamma(X, -) : D_\QCoh(\mathcal{O}_X) \to D(A)$
has cohomological dimension $N$ as explained in
Lemma \ref{lemma-quasi-coherence-direct-image}.
Let $b \in \mathbf{Z}$ be such that $H^i(K) = 0$ for $i > b$.
Let $E$ be pseudo-coherent on $X$.
It suffices to show that $R\Gamma(X, E \otimes^\mathbf{L} K)$
is $m$-pseudo-coherent for every $m$.
Choose an approximation $P \to E$ by a perfect complex $P$
of $(X, E, m - N - 1 - b)$. This is possible by
Theorem \ref{theorem-approximation}.
Choose a distinguished triangle
$$
P \to E \to C \to P[1]
$$
in $D_\QCoh(\mathcal{O}_X)$. The cohomology sheaves of $C$ are zero
in degrees $\geq m - N - 1 - b$. Hence the cohomology
sheaves of $C \otimes^\mathbf{L} K$ are zero in degrees $\geq m - N - 1$.
Thus the cohomology of $R\Gamma(X, C \otimes^\mathbf{L} K)$
are zero in degrees $\geq m - 1$. Hence
$$
R\Gamma(X, P \otimes^\mathbf{L} K) \to R\Gamma(X, E \otimes^\mathbf{L} K)
$$
is an isomorphism on cohomology in degrees $\geq m$.
By assumption the source is pseudo-coherent.
We conclude that $R\Gamma(X, E \otimes^\mathbf{L} K)$
is $m$-pseudo-coherent as desired.
\end{proof}









\section{Relatively perfect objects}
\label{section-relatively-perfect}

\noindent
In this section we introduce a notion from
\cite{lieblich-complexes}.

\begin{definition}
\label{definition-relatively-perfect}
Let $f : X \to S$ be a morphism of schemes which is flat and
locally of finite presentation. An object $E$ of $D(\mathcal{O}_X)$ is
{\it perfect relative to $S$} or
{\it $S$-perfect} if $E$ is pseudo-coherent
(Cohomology, Definition \ref{cohomology-definition-pseudo-coherent}) and
$E$ locally has finite tor dimension as an object of
$D(f^{-1}\mathcal{O}_S)$
(Cohomology, Definition \ref{cohomology-definition-tor-amplitude}).
\end{definition}

\noindent
Please see Remark \ref{remark-discuss-rel-perfect} for a discussion.

\begin{example}
\label{example-relatively-perfect-field}
Let $k$ be a field. Let $X$ be a scheme of finite presentation over $k$
(in particular $X$ is quasi-compact). Then an object $E$ of $D(\mathcal{O}_X)$
is $k$-perfect if and only if it is bounded and pseudo-coherent
(by definition), i.e., if and only if it is in $D^b_{\textit{Coh}}(X)$
(by Lemma \ref{lemma-identify-pseudo-coherent-noetherian}).
Thus being relatively perfect does {\bf not} mean ``perfect on the fibres''.
\end{example}

\noindent
The corresponding algebra concept is studied in
More on Algebra, Section \ref{more-algebra-section-relatively-perfect}.
We can link the notion for schemes with the algebraic notion
as follows.

\begin{lemma}
\label{lemma-affine-locally-rel-perfect}
Let $f : X \to S$ be a morphism of schemes which is flat and
locally of finite presentation. Let $E$ be an object of
$D_\QCoh(\mathcal{O}_X)$. The following are equivalent
\begin{enumerate}
\item $E$ is $S$-perfect,
\item for any affine open $U \subset X$ mapping into an affine open
$V \subset S$ the complex $R\Gamma(U, E)$ is $\mathcal{O}_S(V)$-perfect.
\item there exists an affine open covering $S = \bigcup V_i$
and for each $i$ an affine open covering $f^{-1}(V_i) = \bigcup U_{ij}$
such that the complex $R\Gamma(U_{ij}, E)$ is $\mathcal{O}_S(V_i)$-perfect.
\end{enumerate}
\end{lemma}

\begin{proof}
Being pseudo-coherent is a local property and
``locally having finite tor dimension'' is a local property.
Hence this lemma immediately reduces to the statement:
if $X$ and $S$ are affine, then $E$ is $S$-perfect
if and only if $K = R\Gamma(X, E)$ is $\mathcal{O}_S(S)$-perfect.
Say $X = \Spec(A)$, $S = \Spec(R)$ and $E$ corresponds to
$K \in D(A)$, i.e., $K = R\Gamma(X, E)$, see
Lemma \ref{lemma-affine-compare-bounded}.

\medskip\noindent
Observe that $K$ is $R$-perfect if and only if $K$ is
pseudo-coherent and has finite tor dimension as a complex
of $R$-modules (More on Algebra, Definition
\ref{more-algebra-definition-relatively-perfect}).
By Lemma \ref{lemma-pseudo-coherent-affine}
we see that $E$ is pseudo-coherent if and only if
$K$ is pseudo-coherent.
By Lemma \ref{lemma-tor-dimension-rel-affine} we see that
$E$ has finite tor dimension over $f^{-1}\mathcal{O}_S$
if and only if $K$ has finite tor dimension as a complex of
$R$-modules.
\end{proof}

\begin{lemma}
\label{lemma-triangulated}
Let $f : X \to S$ be a morphism of schemes which is
flat and locally of finite presentation. The full subcategory
of $D(\mathcal{O}_X)$ consisting of $S$-perfect objects is
a saturated\footnote{Derived Categories, Definition
\ref{derived-definition-saturated}.} triangulated subcategory.
\end{lemma}

\begin{proof}
This follows from Cohomology, Lemmas
\ref{cohomology-lemma-cone-pseudo-coherent},
\ref{cohomology-lemma-summands-pseudo-coherent},
\ref{cohomology-lemma-cone-tor-amplitude}, and
\ref{cohomology-lemma-summands-tor-amplitude}.
\end{proof}

\begin{lemma}
\label{lemma-perfect-relatively-perfect}
Let $f : X \to S$ be a morphism of schemes which is flat and locally
of finite presentation. A perfect object of $D(\mathcal{O}_X)$ is $S$-perfect.
If $K, M \in D(\mathcal{O}_X)$, then $K \otimes_{\mathcal{O}_X}^\mathbf{L} M$
is $S$-perfect if $K$ is perfect and $M$ is $S$-perfect.
\end{lemma}

\begin{proof}
First proof: reduce to the affine case using
Lemma \ref{lemma-affine-locally-rel-perfect}
and then apply More on Algebra, Lemma
\ref{more-algebra-lemma-perfect-relatively-perfect}.
\end{proof}

\begin{lemma}
\label{lemma-base-change-relatively-perfect}
Let $f : X \to S$ be a morphism of schemes which is flat and
locally of finite presentation.
Let $g : S' \to S$ be a morphism of schemes. Set $X' = S' \times_S X$
and denote $g' : X' \to X$ the projection.
If $K \in D(\mathcal{O}_X)$ is $S$-perfect, then $L(g')^*K$
is $S'$-perfect.
\end{lemma}

\begin{proof}
First proof: reduce to the affine case using
Lemma \ref{lemma-affine-locally-rel-perfect}
and then apply More on Algebra, Lemma
\ref{more-algebra-lemma-base-change-relatively-perfect}.

\medskip\noindent
Second proof: $L(g')^*K$ is pseudo-coherent by
Cohomology, Lemma \ref{cohomology-lemma-pseudo-coherent-pullback}
and the bounded tor dimension property follows from
Lemma \ref{lemma-tor-independence-and-tor-amplitude}.
\end{proof}

\begin{situation}
\label{situation-relative-descent}
Let $S = \lim_{i \in I} S_i$ be a limit of a directed system of schemes
with affine transition morphisms $g_{i'i} : S_{i'} \to S_i$.
We assume that $S_i$ is quasi-compact and quasi-separated for all $i \in I$.
We denote $g_i : S \to S_i$ the projection. We fix an element $0 \in I$
and a flat morphism of finite presentation $X_0 \to S_0$.
We set $X_i = S_i \times_{S_0} X_0$ and $X = S \times_{S_0} X_0$
and we denote the transition morphisms $f_{i'i} : X_{i'} \to X_i$
and $f_i : X \to X_i$ the projections.
\end{situation}

\begin{lemma}
\label{lemma-relative-descend-homomorphisms}
In Situation \ref{situation-relative-descent}.
Let $K_0$ and $L_0$ be objects of $D(\mathcal{O}_{X_0})$.
Set $K_i = Lf_{i0}^*K_0$ and $L_i = Lf_{i0}^*L_0$ for $i \geq 0$
and set $K = Lf_0^*K_0$ and $L = Lf_0^*L_0$. Then the map
$$
\colim_{i \geq 0} \Hom_{D(\mathcal{O}_{X_i})}(K_i, L_i)
\longrightarrow
\Hom_{D(\mathcal{O}_X)}(K, L)
$$
is an isomorphism if $K_0$ is pseudo-coherent and
$L_0 \in D_\QCoh(\mathcal{O}_{X_0})$ has (locally)
finite tor dimension as an object of
$D((X_0 \to S_0)^{-1}\mathcal{O}_{S_0})$
\end{lemma}

\begin{proof}
For every quasi-compact open $U_0 \subset X_0$ consider the
condition $P$ that
$$
\colim_{i \geq 0} \Hom_{D(\mathcal{O}_{U_i})}(K_i|_{U_i}, L_i|_{U_i})
\longrightarrow
\Hom_{D(\mathcal{O}_U)}(K|_U, L|_U)
$$
is an isomorphism where $U = f_0^{-1}(U_0)$ and $U_i = f_{i0}^{-1}(U_0)$.
If $P$ holds for $U_0$, $V_0$ and $U_0 \cap V_0$, then it holds
for $U_0 \cup V_0$ by Mayer-Vietoris
for hom in the derived category, see
Cohomology, Lemma \ref{cohomology-lemma-mayer-vietoris-hom}.

\medskip\noindent
Denote $\pi_0 : X_0 \to S_0$ the given morphism.
Then we can first consider $U_0 = \pi_0^{-1}(W_0)$ with
$W_0 \subset S_0$ quasi-compact open. By the induction principle of
Cohomology of Schemes, Lemma \ref{coherent-lemma-induction-principle}
applied to quasi-compact opens of $S_0$
and the remark above, we find that it is enough to prove
$P$ for $U_0 = \pi_0^{-1}(W_0)$ with $W_0$ affine.
In other words, we have reduced to the case where $S_0$ is affine.
Next, we apply the induction principle again, this time to all
quasi-compact and quasi-separated opens of $X_0$, to reduce to the
case where $X_0$ is affine as well.

\medskip\noindent
If $X_0$ and $S_0$ are affine, the result follows from
More on Algebra, Lemma \ref{more-algebra-lemma-colimit-relatively-perfect}.
Namely, by Lemmas \ref{lemma-pseudo-coherent} and
\ref{lemma-affine-compare-bounded}
the statement is translated into computations of homs in the
derived categories of modules. Then
Lemma \ref{lemma-pseudo-coherent-affine}
shows that the complex of modules corresponding to $K_0$
is pseudo-coherent. And
Lemma \ref{lemma-tor-dimension-rel-affine}
shows that the complex of modules corresponding to $L_0$
has finite tor dimension over $\mathcal{O}_{S_0}(S_0)$.
Thus the assumptions of
More on Algebra, Lemma \ref{more-algebra-lemma-colimit-relatively-perfect}
are satisfied and we win.
\end{proof}

\begin{lemma}
\label{lemma-descend-relatively-perfect}
In Situation \ref{situation-relative-descent} the category of
$S$-perfect objects of $D(\mathcal{O}_X)$ is the colimit of the categories
of $S_i$-perfect objects of $D(\mathcal{O}_{X_i})$.
\end{lemma}

\begin{proof}
For every quasi-compact open $U_0 \subset X_0$ consider the condition $P$
that the functor
$$
\colim_{i \geq 0} D_{S_i\text{-perfect}}(\mathcal{O}_{U_i})
\longrightarrow
D_{S\text{-perfect}}(\mathcal{O}_U)
$$
is an equivalence where $U = f_0^{-1}(U_0)$ and $U_i = f_{i0}^{-1}(U_0)$.
We observe that we already know this functor is fully faithful
by Lemma \ref{lemma-relative-descend-homomorphisms}. Thus it suffices to prove
essential surjectivity.

\medskip\noindent
Suppose that $P$ holds for quasi-compact opens $U_0$, $V_0$ of $X_0$.
We claim that $P$ holds for $U_0 \cup V_0$. We will use the notation
$U_i = f_{i0}^{-1}U_0$, $U = f_0^{-1}U_0$, $V_i = f_{i0}^{-1}V_0$,
and $V = f_0^{-1}V_0$ and we will abusively use the symbol
$f_i$ for all the morphisms $U \to U_i$, $V \to V_i$,
$U \cap V \to U_i \cap V_i$, and $U \cup V \to U_i \cup V_i$.
Suppose $E$ is an $S$-perfect object of $D(\mathcal{O}_{U \cup V})$.
Goal: show $E$ is in the essential image of the functor.
By assumption,
we can find $i \geq 0$, an $S_i$-perfect object $E_{U, i}$ on $U_i$,
an $S_i$-perfect object $E_{V, i}$ on $V_i$, and
isomorphisms $Lf_i^*E_{U, i} \to E|_U$ and $Lf_i^*E_{V, i} \to E|_V$.
Let
$$
a : E_{U, i} \to (Rf_{i, *}E)|_{U_i}
\quad\text{and}\quad
b : E_{V, i} \to (Rf_{i, *}E)|_{V_i}
$$
the maps adjoint to the isomorphisms $Lf_i^*E_{U, i} \to E|_U$
and $Lf_i^*E_{V, i} \to E|_V$.
By fully faithfulness, after increasing $i$,
we can find an isomorphism
$c : E_{U, i}|_{U_i \cap V_i} \to E_{V, i}|_{U_i \cap V_i}$
which pulls back to the identifications 
$$
Lf_i^*E_{U, i}|_{U \cap V} \to E|_{U \cap V} \to Lf_i^*E_{V, i}|_{U \cap V}.
$$
Apply Cohomology, Lemma \ref{cohomology-lemma-glue}
to get an object $E_i$ on $U_i \cup V_i$ and a map $d : E_i \to Rf_{i, *}E$
which restricts to the maps $a$ and $b$ over $U_i$ and $V_i$.
Then it is clear that $E_i$ is $S_i$-perfect (because being
relatively perfect is a local property) and that
$d$ is adjoint to an isomorphism $Lf_i^*E_i \to E$.

\medskip\noindent
By exactly the same argument as used in
the proof of Lemma \ref{lemma-relative-descend-homomorphisms}
using the induction principle
(Cohomology of Schemes, Lemma \ref{coherent-lemma-induction-principle})
we reduce to the case where both $X_0$ and $S_0$
are affine. (First work with opens in $S_0$ to reduce to
$S_0$ affine, then work with opens in $X_0$ to reduce to
$X_0$ affine.) In the affine case the result follows from
More on Algebra, Lemma \ref{more-algebra-lemma-colimit-relatively-perfect}.
The translation into algebra is done by
Lemma \ref{lemma-affine-locally-rel-perfect}.
\end{proof}

\begin{lemma}
\label{lemma-derived-pushforward-rel-perfect}
Let $f : X \to S$ be a morphism of schemes which is flat, proper, and
of finite presentation. Let $E \in D(\mathcal{O}_X)$ be $S$-perfect.
Then $Rf_*E$ is a perfect object of $D(\mathcal{O}_S)$
and its formation commutes with arbitrary base change.
\end{lemma}

\begin{proof}
The statement on base change is Lemma \ref{lemma-compare-base-change}.
Thus it suffices to show that $Rf_*E$ is a perfect object. We will reduce
to the case where $S$ is Noetherian affine by a limit argument.

\medskip\noindent
The question is local on $S$, hence we may assume $S$ is affine.
Say $S = \Spec(R)$. We write $R = \colim R_i$ as a filtered colimit
of Noetherian rings $R_i$. By Limits, Lemma
\ref{limits-lemma-descend-finite-presentation}
there exists an $i$ and a scheme $X_i$ of finite presentation over $R_i$
whose base change to $R$ is $X$. By
Limits, Lemmas \ref{limits-lemma-eventually-proper} and
\ref{limits-lemma-descend-flat-finite-presentation}
we may assume $X_i$ is proper and flat over $R_i$.
By Lemma \ref{lemma-descend-relatively-perfect}
we may assume there exists a $R_i$-perfect object $E_i$ of
$D(\mathcal{O}_{X_i})$ whose pullback to $X$ is $E$.
Applying Lemma \ref{lemma-perfect-direct-image}
to $X_i \to \Spec(R_i)$ and $E_i$ and using the
base change property already shown we obtain the result.
\end{proof}

\begin{lemma}
\label{lemma-compute-ext-rel-perfect}
Let $f : X \to S$ be a morphism of schemes. Let $E, K \in D(\mathcal{O}_X)$.
Assume
\begin{enumerate}
\item $S$ is quasi-compact and quasi-separated,
\item $f$ is proper, flat, and of finite presentation,
\item $E$ is $S$-perfect,
\item $K$ is pseudo-coherent.
\end{enumerate}
Then there exists a pseudo-coherent $L \in D(\mathcal{O}_S)$ such that
$$
Rf_*R\SheafHom(K, E) = R\SheafHom(L, \mathcal{O}_S)
$$
and the same is true after arbitrary base change: given
$$
\vcenter{
\xymatrix{
X' \ar[r]_{g'} \ar[d]_{f'} &
X \ar[d]^f \\
S' \ar[r]^g &
S
}
}
\quad\quad
\begin{matrix}
\text{cartesian, then we have } \\
Rf'_*R\SheafHom(L(g')^*K, L(g')^*E) \\
= R\SheafHom(Lg^*L, \mathcal{O}_{S'})
\end{matrix}
$$
\end{lemma}

\begin{proof}
Since $S$ is quasi-compact and quasi-separated, the same is true for $X$.
By Lemma \ref{lemma-pseudo-coherent-hocolim} we can write
$K = \text{hocolim} K_n$ with $K_n$ perfect and $K_n \to K$ inducing
an isomorphism on truncations $\tau_{\geq -n}$. Let $K_n^\vee$
be the dual perfect complex
(Cohomology, Lemma \ref{cohomology-lemma-dual-perfect-complex}).
We obtain an inverse system $\ldots \to K_3^\vee \to K_2^\vee \to K_1^\vee$
of perfect objects. By Lemma \ref{lemma-perfect-relatively-perfect}
we see that $K_n^\vee \otimes_{\mathcal{O}_X} E$ is $S$-perfect.
Thus we may apply Lemma \ref{lemma-derived-pushforward-rel-perfect}
to $K_n^\vee \otimes_{\mathcal{O}_X} E$ and we obtain an inverse system
$$
\ldots \to M_3 \to M_2 \to M_1
$$
of perfect complexes on $S$ with
$$
M_n = Rf_*(K_n^\vee \otimes_{\mathcal{O}_X}^\mathbf{L} E) =
Rf_*R\SheafHom(K_n, E)
$$
Moreover, the formation of these complexes commutes with any
base change, namely $Lg^*M_n =
Rf'_*((L(g')^*K_n)^\vee \otimes_{\mathcal{O}_{X'}}^\mathbf{L} L(g')^*E) =
Rf'_*R\SheafHom(L(g')^*K_n, L(g')^*E)$.

\medskip\noindent
As $K_n \to K$ induces an isomorphism on $\tau_{\geq -n}$, we see that
$K_n \to K_{n + 1}$ induces an isomorphism on $\tau_{\geq -n}$.
It follows that $K_{n + 1}^\vee \to K_n^\vee$
induces an isomorphism on $\tau_{\leq n}$ as
$K_n^\vee = R\SheafHom(K_n, \mathcal{O}_X)$.
Suppose that $E$ has tor amplitude in $[a, b]$ as a complex
of $f^{-1}\mathcal{O}_Y$-modules. Then the same is true after
any base change, see Lemma \ref{lemma-tor-independence-and-tor-amplitude}.
We find that
$K_{n + 1}^\vee \otimes_{\mathcal{O}_X} E \to
K_n^\vee \otimes_{\mathcal{O}_X} E$
induces an isomorphism on $\tau_{\leq n + a}$
and the same is true after any base change.
Applying the right derived functor $Rf_*$
we conclude the maps $M_{n + 1} \to M_n$
induce isomorphisms on $\tau_{\leq n + a}$
and the same is true after any base change.
Choose a distinguished triangle
$$
M_{n + 1} \to M_n \to C_n \to M_{n + 1}[1]
$$
Take $S'$ equal to the spectrum of the residue field at a point
$s \in S$ and pull back to see that
$C_n \otimes_{\mathcal{O}_S}^\mathbf{L} \kappa(s)$
has nonzero cohomology only in degrees $\geq n + a$. By
More on Algebra, Lemma
\ref{more-algebra-lemma-lift-perfect-from-residue-field}
we see that the perfect complex $C_n$ has tor amplitude in
$[n + a, m_n]$ for some integer $m_n$.
In particular, the dual perfect complex $C_n^\vee$ has tor amplitude in
$[-m_n, -n - a]$.

\medskip\noindent
Let $L_n = M_n^\vee$ be the dual perfect complex. The
conclusion from the discussion in the previous paragraph is that
$L_n \to L_{n + 1}$ induces isomorphisms on $\tau_{\geq -n - a}$.
Thus $L = \text{hocolim} L_n$ is pseudo-coherent, see
Lemma \ref{lemma-pseudo-coherent-hocolim}.
Since we have
$$
R\SheafHom(K, E) = R\SheafHom(\text{hocolim} K_n, E) =
R\lim R\SheafHom(K_n, E) = R\lim K_n^\vee \otimes_{\mathcal{O}_X} E
$$
(Cohomology, Lemma \ref{cohomology-lemma-colim-and-lim-of-duals})
and since $R\lim$ commutes with $Rf_*$ we find that
$$
Rf_*R\SheafHom(K, E) = R\lim M_n = R\lim R\SheafHom(L_n, \mathcal{O}_S) =
R\SheafHom(L, \mathcal{O}_S)
$$
This proves the formula over $S$. Since the construction of $M_n$ is
compatible with base chance, the formula continues to hold after
any base change.
\end{proof}

\begin{remark}
\label{remark-compare-L}
The reader may have noticed the similarity between
Lemma \ref{lemma-compute-ext-rel-perfect} and
Lemma \ref{lemma-compute-ext}.
Indeed, the pseudo-coherent complex $L$ of
Lemma \ref{lemma-compute-ext-rel-perfect}
may be characterized as the unique pseudo-coherent complex
on $S$ such that there are functorial isomorphisms
$$
\Ext^i_{\mathcal{O}_S}(L, \mathcal{F}) \longrightarrow
\Ext^i_{\mathcal{O}_X}(K,
E \otimes_{\mathcal{O}_X}^\mathbf{L} Lf^*\mathcal{F})
$$
compatible with boundary maps for $\mathcal{F}$ ranging over
$\QCoh(\mathcal{O}_S)$. If we ever need this we will
formulate a precise result here and give a detailed proof.
\end{remark}

\begin{lemma}
\label{lemma-bounded-on-fibres}
Let $f : X \to S$ be a morphism of schemes which is flat and
locally of finite presentation. Let $E$ be a pseudo-coherent
object of $D(\mathcal{O}_X)$. The following are equivalent
\begin{enumerate}
\item $E$ is $S$-perfect, and
\item $E$ is locally bounded below and for every point $s \in S$
the object $L(X_s \to X)^*E$ of $D(\mathcal{O}_{X_s})$
is locally bounded below.
\end{enumerate}
\end{lemma}

\begin{proof}
Since everything is local we immediately reduce to the
case that $X$ and $S$ are affine, see Lemma
\ref{lemma-affine-locally-rel-perfect}.
Say $X \to S$ corresponds to $\Spec(A) \to \Spec(R)$ and
$E$ corresponds to $K$ in $D(A)$. If $s$ corresponds to
the prime $\mathfrak p \subset R$, then $L(X_s \to X)^*E$
corresponds to $K \otimes_R^\mathbf{L} \kappa(\mathfrak p)$
as $R \to A$ is flat, see for example
Lemma \ref{lemma-compare-base-change}.
Thus we see that our lemma follows from the corresponding algebra
result, see More on Algebra, Lemma
\ref{more-algebra-lemma-bounded-on-fibres-relatively-perfect}.
\end{proof}

\begin{remark}
\label{remark-discuss-rel-perfect}
Our Definition \ref{definition-relatively-perfect} of a
relatively perfect complex is equivalent to the one given
in \cite{lieblich-complexes} whenever our definition applies\footnote{To
see this, use Lemma \ref{lemma-affine-locally-rel-perfect} and
More on Algebra, Lemma \ref{more-algebra-lemma-structure-relatively-perfect}.}.
Next, suppose that $f : X \to S$ is only assumed to be locally
of finite type (not necessarily flat, nor locally of finite
presentation). The definition in the paper cited above is that
$E \in D(\mathcal{O}_X)$ is relatively perfect if
\begin{enumerate}
\item[(A)] locally on $X$ the object $E$ should be
quasi-isomorphic to a finite complex of
$S$-flat, finitely presented $\mathcal{O}_X$-modules.
\end{enumerate}
On the other hand, the natural generalization of our
Definition \ref{definition-relatively-perfect} is
\begin{enumerate}
\item[(B)] $E$ is pseudo-coherent relative to $S$
(More on Morphisms, Definition
\ref{more-morphisms-definition-relative-pseudo-coherence})
and $E$ locally has finite tor dimension as an object of
$D(f^{-1}\mathcal{O}_S)$
(Cohomology, Definition \ref{cohomology-definition-tor-amplitude}).
\end{enumerate}
The advantage of condition (B) is that it clearly defines a triangulated
subcategory of $D(\mathcal{O}_X)$, whereas we suspect this is not
the case for condition (A). The advantage of condition (A)
is that it is easier to work with in particular in regards to limits.
\end{remark}









\section{The resolution property}
\label{section-resolution-property}

\noindent
This notion is discussed in the paper \cite{totaro_resolution};
the discussion is continued in \cite{Gross-thesis},
\cite{Gross-surface}, and \cite{Gross-stack}.
It is currently not known if a proper scheme over a field
always has the resolution property or if this is false.
If you know the answer to this question, please email
\href{mailto:stacks.project@gmail.com}{stacks.project@gmail.com}.

\medskip\noindent
We can make the following definition although it scarcely makes
sense to consider it for general schemes.

\begin{definition}
\label{definition-resolution-property}
Let $X$ be a scheme. We say $X$ has the {\it resolution property}
if every quasi-coherent $\mathcal{O}_X$-module of finite type
is the quotient of a finite locally free $\mathcal{O}_X$-module.
\end{definition}

\noindent
If $X$ is a quasi-compact and quasi-separated scheme, then it suffices to check
every $\mathcal{O}_X$-module module of finite presentation (automatically
quasi-coherent) is the quotient of a finite locally free
$\mathcal{O}_X$-module, see Properties, Lemma
\ref{properties-lemma-finite-directed-colimit-surjective-maps}.
If $X$ is a Noetherian scheme, then finite type quasi-coherent modules
are exactly the coherent $\mathcal{O}_X$-modules, see
Cohomology of Schemes, Lemma \ref{coherent-lemma-coherent-Noetherian}.

\begin{lemma}
\label{lemma-resolution-property-ample}
Let $X$ be a scheme. If $X$ has an ample invertible $\mathcal{O}_X$-module,
then $X$ has the resolution property.
\end{lemma}

\begin{proof}
Immediate consequence of Properties, Proposition
\ref{properties-proposition-characterize-ample}.
\end{proof}

\begin{lemma}
\label{lemma-resolution-property-ample-relative}
Let $f : X \to Y$ be a morphism of schemes. Assume
\begin{enumerate}
\item $Y$ is quasi-compact and quasi-separated and has the resolution property,
\item there exists an $f$-ample invertible module on $X$.
\end{enumerate}
Then $X$ has the resolution property.
\end{lemma}

\begin{proof}
Let $\mathcal{F}$ be a finite type quasi-coherent $\mathcal{O}_X$-module.
Let $\mathcal{L}$ be an $f$-ample invertible module.
Choose an affine open covering $Y = V_1 \cup \ldots \cup V_m$.
Set $U_j = f^{-1}(V_j)$. By Properties, Proposition
\ref{properties-proposition-characterize-ample}
for each $j$ we know there exists finitely many maps
$s_{j, i} : \mathcal{L}^{\otimes n_{j, i}}|_{U_j} \to \mathcal{F}|_{U_j}$
which are jointly surjective. Consider the quasi-coherent
$\mathcal{O}_Y$-modules
$$
\mathcal{H}_n =
f_*(\mathcal{F} \otimes_{\mathcal{O}_X} \mathcal{L}^{\otimes n})
$$
We may think of $s_{j, i}$ as a section over $V_j$ of the sheaf
$\mathcal{H}_{-n_{j, i}}$. Suppose we can find finite locally
free $\mathcal{O}_Y$-modules $\mathcal{E}_{i, j}$ and maps
$\mathcal{E}_{i, j} \to \mathcal{H}_{-n_{j, i}}$ such that
$s_{j, i}$ is in the image. Then the corresponding maps
$$
f^*\mathcal{E}_{i, j}
\otimes_{\mathcal{O}_X}
\mathcal{L}^{\otimes n_{i, j}} \longrightarrow \mathcal{F}
$$
are going to be jointly surjective and the lemma is proved. By
Properties, Lemma \ref{properties-lemma-quasi-coherent-colimit-finite-type}
for each $i, j$ we can find a finite
type quasi-coherent submodule
$\mathcal{H}'_{i, j} \subset  \mathcal{H}_{-n_{j, i}}$
which contains the section $s_{i, j}$ over $V_j$.
Thus the resolution property of $Y$ produces surjections
$\mathcal{E}_{i, j} \to \mathcal{H}'_{j, i}$ and we conclude.
\end{proof}

\begin{lemma}
\label{lemma-resolution-property-goes-up-affine}
Let $f : X \to Y$ be an affine or quasi-affine morphism of schemes with
$Y$ quasi-compact and quasi-separated.
If $Y$ has the resolution property, so does $X$.
\end{lemma}

\begin{proof}
By Morphisms, Lemma \ref{morphisms-lemma-quasi-affine-O-ample}
this is a special case of
Lemma \ref{lemma-resolution-property-ample-relative}.
\end{proof}

\noindent
Here is a case where one can prove the resolution property goes down.

\begin{lemma}
\label{lemma-resolution-property-goes-down-finite-flat}
Let $f : X \to Y$ be a surjective finite locally free morphism of schemes.
If $X$ has the resolution property, so does $Y$.
\end{lemma}

\begin{proof}
The condition means that $f$ is affine and that $f_*\mathcal{O}_X$
is a finite locally free $\mathcal{O}_Y$-module of positive rank.
Let $\mathcal{G}$ be a quasi-coherent $\mathcal{O}_Y$-module
of finite type. By assumption there exists a surjection
$\mathcal{E} \to f^*\mathcal{G}$ for some finite locally free
$\mathcal{O}_X$-module $\mathcal{E}$. Since $f_*$ is exact on
quasi-coherent modules
(Cohomology of Schemes, Lemma \ref{coherent-lemma-relative-affine-vanishing})
we get a surjection
$$
f_*\mathcal{E}
\longrightarrow
f_*f^*\mathcal{G} = \mathcal{G} \otimes_{\mathcal{O}_Y} f_*\mathcal{O}_X
$$
Taking duals we get a surjection
$$
f_*\mathcal{E}
\otimes_{\mathcal{O}_Y}
\SheafHom_{\mathcal{O}_Y}(f_*\mathcal{O}_X, \mathcal{O}_Y)
\longrightarrow
\mathcal{G}
$$
Since $f_*\mathcal{E}$ is finite locally free\footnote{Namely,
if $A \to B$ is a finite locally free ring map
and $N$ is a finite locally free $B$-module, then $N$
is a finite locally free $A$-module. To see this, first note
that $N$ finite locally free over $B$ implies $N$ is
flat and finitely presented as a $B$-module, see
Algebra, Lemma \ref{algebra-lemma-finite-projective}. Then
$N$ is an $A$-module of finite presentation by
Algebra, Lemma \ref{algebra-lemma-finite-finitely-presented-extension}
and a flat $A$-module by Algebra, Lemma \ref{algebra-lemma-composition-flat}.
Then conclude by using
Algebra, Lemma \ref{algebra-lemma-finite-projective} over $A$.},
we conclude.
\end{proof}

\begin{lemma}
\label{lemma-resolution-property-finite-number}
Let $X$ be a scheme. Suppose given
\begin{enumerate}
\item a finite affine open covering $X = U_1 \cup \ldots \cup U_m$
\item finite type quasi-coherent ideals $\mathcal{I}_j$
with $V(\mathcal{I}_j) = X \setminus U_j$
\end{enumerate}
Then $X$ has the resolution property if and only if $\mathcal{I}_j$
is the quotient of a finite locally free $\mathcal{O}_X$-module
for $j = 1, \ldots, m$.
\end{lemma}

\begin{proof}
One direction of the lemma is trivial. For the other, 
say $\mathcal{E}_j \to \mathcal{I}_j$ is a surjection with
$\mathcal{E}_j$ finite locally free. In the next paragraph, we
reduce to the Noetherian case; we suggest the reader skip it.

\medskip\noindent
The first observation is that $U_j \cap U_{j'}$ is quasi-compact
as the complement of the zero scheme of the quasi-coherent finite type ideal
$\mathcal{I}_{j'}|{U_j}$ on the affine scheme $U_j$, see
Properties, Lemma \ref{properties-lemma-quasi-coherent-finite-type-ideals}.
Hence $X$ is quasi-compact and quasi-separated, see
Schemes, Lemma \ref{schemes-lemma-characterize-quasi-separated}.
By Limits, Proposition \ref{limits-proposition-approximate}
we can write $X = \lim X_i$ as the limit of a direct system of
Noetherian schemes with affine transition morphisms. For each $j$
we can find an $i$ and a finite locally free $\mathcal{O}_{X_i}$-module
$\mathcal{E}_{i, j}$ pulling back to $\mathcal{E}_j$, see
Limits, Lemma \ref{limits-lemma-descend-invertible-modules}.
After increasing $i$ we may assume that the composition
$\mathcal{E}_j \to \mathcal{I}_j \to \mathcal{O}_X$ is the
pullback of a map $\mathcal{E}_{i, j} \to \mathcal{O}_{X_i}$, see
Limits, Lemma \ref{limits-lemma-descend-modules-finite-presentation}.
Denote $\mathcal{I}_{i, j} \subset \mathcal{O}_{X_i}$ the image
of this map; this is a quasi-coherent ideal sheaf on the Noetherian
scheme $X_i$ whose pullback to $X$ is $\mathcal{I}_j$.
Denoting $U_{i, j} \subset X_i$ the complementary opens, we
may assume these are affine for all $i, j$, see
Limits, Lemma \ref{limits-lemma-limit-affine}.
If we can prove the lemma for the opens $U_{i, j}$ and the
ideal sheaves $\mathcal{I}_{i, j}$ on $X_i$ then $X$, being affine
over $X_i$, will have the resolution property by
Lemma \ref{lemma-resolution-property-goes-up-affine}.
In this way we reduce to the case of a Noetherian scheme.

\medskip\noindent
Assume $X$ is Noetherian. For every coherent module $\mathcal{F}$
we can choose a finite list of sections $s_{jk} \in \mathcal{F}(U_j)$,
$k = 1, \ldots, e_j$ which generate the restriction of $\mathcal{F}$ to $U_j$.
By Cohomology of Schemes, Lemma \ref{coherent-lemma-homs-over-open}
we can extend $s_{jk}$ to a map
$s'_{jk} : \mathcal{I}_i^{n_{jk}} \to \mathcal{F}$ for some $n_{jk} \geq 1$.
Then we can consider the compositions
$$
\mathcal{E}_j^{\otimes n_{jk}} \to \mathcal{I}_j^{n_{jk}} \to \mathcal{F}
$$
to conclude.
\end{proof}

\begin{lemma}
\label{lemma-resolution-property-ample-family}
Let $X$ be a scheme. If $X$ has an ample family of invertible modules
(Morphisms, Definition
\ref{morphisms-definition-family-ample-invertible-modules}),
then $X$ has the resolution property.
\end{lemma}

\begin{proof}
Since $X$ is quasi-compact, there exists $n$ and pairs
$(\mathcal{L}_i, s_i)$, $i = 1, \ldots, n$ where
$\mathcal{L}_i$ is an invertible $\mathcal{O}_X$-module and
$s_i \in \Gamma(X, \mathcal{L}_i)$ is a section
such that the set of points $U_i \subset X$ where $s_i$ is nonvanishing
is affine and $X = U_1 \cup \ldots \cup U_n$.
Let $\mathcal{I}_i \subset \mathcal{O}_X$ be the image
of $s_i : \mathcal{L}_i^{\otimes -1} \to \mathcal{O}_X$.
Applying Lemma \ref{lemma-resolution-property-finite-number}
we find that $X$ has the resolution property.
\end{proof}

\begin{lemma}
\label{lemma-regular-resolution-property}
Let $X$ be a quasi-compact, regular scheme with affine diagonal.
Then $X$ has the resolution property.
\end{lemma}

\begin{proof}
Combine Divisors, Lemma \ref{divisors-lemma-regular-ample-family} and the above
Lemma \ref{lemma-resolution-property-ample-family}.
\end{proof}

\begin{lemma}
\label{lemma-resolution-property-descends}
Let $X = \lim X_i$ be a limit of a direct system of quasi-compact
and quasi-separated schemes with affine transition morphisms.
Then $X$ has the resolution property if and only if $X_i$ has
the resolution properties for some $i$.
\end{lemma}

\begin{proof}
If $X_i$ has the resolution property, then $X$ does by
Lemma \ref{lemma-resolution-property-goes-up-affine}.
Assume $X$ has the resolution property.
Choose $i \in I$. Choose a finite affine open covering
$X_i = U_{i, 1} \cup \ldots \cup U_{i, m}$.
For each $j$ choose a finite type quasi-coherent sheaf
of ideals $\mathcal{I}_{i, j} \subset \mathcal{O}_{X_i}$
such that $X_i \setminus V(\mathcal{I}_{i, j}) = U_{i, j}$, see
Properties, Lemma \ref{properties-lemma-quasi-coherent-finite-type-ideals}.
Denote $U_j \subset X$ the inverse image of $U_{i, j}$
and denote $\mathcal{I}_j \subset \mathcal{O}_X$
the pullback of $\mathcal{I}_{i, j}$.
Since $X$ has the resolution property, we may
choose finite locally free $\mathcal{O}_X$-modules $\mathcal{E}_j$
and surjections $\mathcal{E}_j \to \mathcal{I}_j$.
By Limits, Lemmas \ref{limits-lemma-descend-invertible-modules} and
\ref{limits-lemma-descend-modules-finite-presentation}
after increasing $i$ we can find finite locally free
$\mathcal{O}_{X_i}$-modules $\mathcal{E}_{i, j}$
and maps $\mathcal{E}_{i, j} \to \mathcal{O}_{X_i}$
whose base changes to $X$ recover the compositions
$\mathcal{E}_j \to \mathcal{I}_j \to \mathcal{O}_X$, $j = 1, \ldots, m$.
The pullbacks of the finitely presented $\mathcal{O}_{X_i}$-modules
$\Coker(\mathcal{E}_{i, j} \to \mathcal{O}_{X_i})$
and $\mathcal{O}_{X_i}/\mathcal{I}_{i, j}$
to $X$ agree as quotients of $\mathcal{O}_X$.
Hence by Limits, Lemma
\ref{limits-lemma-descend-modules-finite-presentation}
we may assume that these agree, in other words that
the image of $\mathcal{E}_{i, j} \to \mathcal{O}_{X_i}$
is equal to $\mathcal{I}_{i, j}$.
Then we conclude that $X_i$ has the resolution property
by Lemma \ref{lemma-resolution-property-finite-number}.
\end{proof}

\begin{lemma}
\label{lemma-resolution-property-affine-diagonal}
\begin{reference}
Special case of \cite[Proposition 1.3]{totaro_resolution}.
\end{reference}
Let $X$ be a quasi-compact and quasi-separated scheme with
the resolution property. Then $X$ has affine diagonal.
\end{lemma}

\begin{proof}
Combining Limits, Proposition \ref{limits-proposition-approximate}
and Lemma \ref{lemma-resolution-property-descends}
this reduces to the case where $X$ is Noetherian (small detail omitted).
Assume $X$ is Noetherian.
Recall that $X \times X$ is covered by the affine opens
$U \times V$ for affine opens $U$, $V$ of $X$, see
Schemes, Section \ref{schemes-section-fibre-products}.
Hence to show that the diagonal $\Delta : X \to X \times X$
is affine, it suffices to show that $U \cap V = \Delta^{-1}(U \times V)$
is affine for all affine opens $U$, $V$ of $X$, see
Morphisms, Lemma \ref{morphisms-lemma-characterize-affine}.
In particular, it suffices to show that the inclusion morphism
$j : U \to X$ is affine if $U$ is an affine open of $X$.
By Cohomology of Schemes, Lemma \ref{coherent-lemma-criterion-affine-morphism}
it suffices to show that $R^1j_*\mathcal{G} = 0$ for any
quasi-coherent $\mathcal{O}_U$-module $\mathcal{G}$.
By Proposition \ref{proposition-Noetherian} (this is where we use
that we've reduced to the Noetherian case)
we can represent $Rj_*\mathcal{G}$ by a complex
$\mathcal{H}^\bullet$ of quasi-coherent $\mathcal{O}_X$-modules.
Assume
$$
H^1(\mathcal{H}^\bullet) =
\Ker(\mathcal{H}^1 \to \mathcal{H}^2)/\Im(\mathcal{H}^0 \to \mathcal{H}^1)
$$
is nonzero in order to get a contradiction. Then we can find a coherent
$\mathcal{O}_X$-module $\mathcal{F}$ and a map
$$
\mathcal{F} \longrightarrow
\Ker(\mathcal{H}^1 \to \mathcal{H}^2)
$$
such that the composition with the projection onto $H^1(\mathcal{H}^\bullet)$
is nonzero. Namely, we can write $\Ker(\mathcal{H}^1 \to \mathcal{H}^2)$
as the filtered union of its coherent submodules by
Properties, Lemma \ref{properties-lemma-quasi-coherent-colimit-finite-type}
and then one of these will do the job.
Next, we choose a finite locally free $\mathcal{O}_X$-module
$\mathcal{E}$ and a surjection $\mathcal{E} \to \mathcal{F}$ using
the resolution property of $X$.
This produces a map in the derived category
$$
\mathcal{E}[-1] \longrightarrow Rj_*\mathcal{G}
$$
which is nonzero on cohomology sheaves and hence nonzero in $D(\mathcal{O}_X)$.
By adjunction, this is the same thing as a map
$$
j^*\mathcal{E}[-1] \to \mathcal{G}
$$
nonzero in $D(\mathcal{O}_U)$. Since $\mathcal{E}$ is finite locally
free this is the same thing as a nonzero element of
$$
H^1(U, j^*\mathcal{E}^\vee \otimes_{\mathcal{O}_U} \mathcal{G})
$$
where
$\mathcal{E}^\vee = \SheafHom_{\mathcal{O}_X}(\mathcal{E}, \mathcal{O}_X)$
is the dual finite locally free module. However, this group is zero by
Cohomology of Schemes, Lemma
\ref{coherent-lemma-quasi-coherent-affine-cohomology-zero}
which is the desired contradiction.
(If in doubt about the step using duals, please see the more general
Cohomology, Lemma \ref{cohomology-lemma-dual-perfect-complex}.)
\end{proof}






\section{The resolution property and perfect complexes}
\label{section-resolution-property-perfect}

\noindent
In this section we discuss the relationship between perfect complexes
and strictly perfect complexes on schemes which have the resolution property.

\begin{lemma}
\label{lemma-construct-strictly-perfect}
Let $X$ be a quasi-compact and quasi-separated scheme with the
resolution property.
Let $\mathcal{F}^\bullet$ be a bounded below complex of quasi-coherent
$\mathcal{O}_X$-modules representing a perfect object of
$D(\mathcal{O}_X)$. Then there exists a bounded complex
$\mathcal{E}^\bullet$ of finite locally free $\mathcal{O}_X$-modules
and a quasi-isomorphism $\mathcal{E}^\bullet \to \mathcal{F}^\bullet$.
\end{lemma}

\begin{proof}
Let $a, b \in \mathbf{Z}$ be integers such that $\mathcal{F}^\bullet$
has tor amplitude in $[a, b]$ and such that $\mathcal{F}^n = 0$ for
$n < a$. The existence of such a pair of integers
follows from Cohomology, Lemma \ref{cohomology-lemma-perfect}
and the fact that $X$ is quasi-compact.
If $b < a$, then $\mathcal{F}^\bullet$ is zero in the
derived category and the lemma holds.
We will prove by induction on
$b - a \geq 0$ that there exists a complex
$\mathcal{E}^a \to \ldots \to \mathcal{E}^b$
with $\mathcal{E}^i$ finite locally free
and a quasi-isomorphism $\mathcal{E}^\bullet \to \mathcal{F}^\bullet$.

\medskip\noindent
The base case is the case $b - a = 0$. In this case
$H^b(\mathcal{F}^\bullet) = H^a(\mathcal{F}^\bullet) =
\Ker(\mathcal{F}^a \to \mathcal{F}^{a + 1})$
is finite locally free. Namely, it is a finitely presented
$\mathcal{O}_X$-module of tor dimension $0$ and hence finite
locally free. See Cohomology, Lemmas \ref{cohomology-lemma-perfect} and
\ref{cohomology-lemma-finite-cohomology} and
Properties, Lemma \ref{properties-lemma-finite-locally-free}.
Thus we can take $\mathcal{E}^\bullet$ to be
$H^b(\mathcal{F}^\bullet)$ sitting in degree $b$.
The rest of the proof is dedicated to the induction step.

\medskip\noindent
Assume $b > a$. Observe that
$$
H^b(\mathcal{F}^\bullet) =
\Ker(\mathcal{F}^b \to \mathcal{F}^{b + 1})/
\Im(\mathcal{F}^{b - 1} \to \mathcal{F}^b)
$$
is a finite type quasi-coherent $\mathcal{O}_X$-module, see
Cohomology, Lemmas \ref{cohomology-lemma-perfect} and
\ref{cohomology-lemma-finite-cohomology}. Then we can find a finite type
quasi-coherent $\mathcal{O}_X$-module $\mathcal{F}$ and a map
$$
\mathcal{F} \longrightarrow
\Ker(\mathcal{F}^b \to \mathcal{F}^{b + 1})
$$
such that the composition with the projection onto
$H^b(\mathcal{F}^\bullet)$ is surjective.
Namely, we can write $\Ker(\mathcal{F}^b \to \mathcal{F}^{b + 1})$
as the filtered union of its finite type quasi-coherent submodules by
Properties, Lemma \ref{properties-lemma-quasi-coherent-colimit-finite-type}
and then one of these will do the job.
Next, we choose a finite locally free $\mathcal{O}_X$-module
$\mathcal{E}^b$ and a surjection $\mathcal{E}^b \to \mathcal{F}$ using
the resolution property of $X$. Consider the map of complexes
$$
\alpha : \mathcal{E}^b[-b] \to \mathcal{F}^\bullet
$$
and its cone $C(\alpha)^\bullet$, see
Derived Categories, Definition \ref{derived-definition-cone}.
We observe that $C(\alpha)^\bullet$ is nonzero only in degrees
$\geq a$, has tor amplitude in $[a, b]$ by
Cohomology, Lemma \ref{cohomology-lemma-cone-tor-amplitude},
and has $H^b(C(\alpha)^\bullet) = 0$ by construction.
Thus we actually find that $C(\alpha)^\bullet$ has tor amplitude
in $[a, b - 1]$. Hence the induction hypothesis applies to
$C(\alpha)^\bullet$ and we find a map of complexes
$$
(\mathcal{E}^a \to \ldots \to \mathcal{E}^{b - 1})
\longrightarrow
C(\alpha)^\bullet
$$
with properties as stated in the induction hypothesis. Unwinding
the definition of the cone this gives a commutative diagram
$$
\xymatrix{
\ldots \ar[r] &
\mathcal{E}^{b - 2} \ar[r] \ar[d] &
\mathcal{E}^{b - 1} \ar[r] \ar[d] &
0 \ar[r] \ar[d] &
\ldots \\
\ldots \ar[r] &
\mathcal{F}^{b - 2} \ar[r] &
\mathcal{F}^{b - 1} \oplus \mathcal{E}^b \ar[r] &
\mathcal{F}^b \ar[r] &
\ldots
}
$$
It is clear that we obtain a map of complexes
$(\mathcal{E}^a \to \ldots \to \mathcal{E}^b) \to \mathcal{F}^\bullet$.
We omit the verification that this map is a quasi-isomorphism.
\end{proof}

\begin{lemma}
\label{lemma-resolution-property-perfect-complex}
Let $X$ be a quasi-compact and quasi-separated scheme with the
resolution property. Then every perfect object of $D(\mathcal{O}_X)$
can be represented by a bounded complex of finite locally free
$\mathcal{O}_X$-modules.
\end{lemma}

\begin{proof}
Let $E$ be a perfect object of $D(\mathcal{O}_X)$.
By Lemma \ref{lemma-resolution-property-affine-diagonal}
we see that $X$ has affine diagonal. Hence by
Proposition \ref{proposition-quasi-compact-affine-diagonal}
we can represent $E$ by a complex $\mathcal{F}^\bullet$
of quasi-coherent $\mathcal{O}_X$-modules.
Observe that $E$ is in $D^b(\mathcal{O}_X)$ because
$X$ is quasi-compact. Hence $\tau_{\geq n}\mathcal{F}^\bullet$
is a bounded below complex of quasi-coherent $\mathcal{O}_X$-modules
which represents $E$ if $n \ll 0$. Thus we may apply
Lemma \ref{lemma-construct-strictly-perfect} to conclude.
\end{proof}

\begin{lemma}
\label{lemma-resolution-property-map-perfect-complex}
Let $X$ be a quasi-compact and quasi-separated scheme with the
resolution property. Let $\mathcal{E}^\bullet$ and $\mathcal{F}^\bullet$
be finite complexes of finite locally free $\mathcal{O}_X$-modules.
Then any
$\alpha \in \Hom_{D(\mathcal{O}_X)}(\mathcal{E}^\bullet, \mathcal{F}^\bullet)$
can be represented by a diagram
$$
\mathcal{E}^\bullet \leftarrow \mathcal{G}^\bullet \to \mathcal{F}^\bullet
$$
where $\mathcal{G}^\bullet$ is a bounded complex of finite locally free
$\mathcal{O}_X$-modules and where $\mathcal{G}^\bullet \to \mathcal{E}^\bullet$
is a quasi-isomorphism.
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-resolution-property-affine-diagonal}
we see that $X$ has affine diagonal. Hence by
Proposition \ref{proposition-quasi-compact-affine-diagonal}
we can represent $\alpha$ by a diagram
$$
\mathcal{E}^\bullet \leftarrow \mathcal{H}^\bullet \to \mathcal{F}^\bullet
$$
where $\mathcal{H}^\bullet$ is a complex of quasi-coherent
$\mathcal{O}_X$-modules and where
$\mathcal{H}^\bullet \to \mathcal{E}^\bullet$
is a quasi-isomorphism. For $n \ll 0$ the maps
$\mathcal{H}^\bullet \to \mathcal{E}^\bullet$ and
$\mathcal{H}^\bullet \to \mathcal{F}^\bullet$
factor through the quasi-isomorphism
$\mathcal{H}^\bullet \to \tau_{\geq n}\mathcal{H}^\bullet$
simply because $\mathcal{E}^\bullet$ and $\mathcal{F}^\bullet$
are bounded complexes. Thus we may replace $\mathcal{H}^\bullet$
by $\tau_{\geq n}\mathcal{H}^\bullet$ and assume that $\mathcal{H}^\bullet$
is bounded below.
Then we may apply
Lemma \ref{lemma-construct-strictly-perfect} to conclude.
\end{proof}

\begin{lemma}
\label{lemma-resolution-property-homotopy-map-perfect-complex}
Let $X$ be a quasi-compact and quasi-separated scheme with the
resolution property. Let $\mathcal{E}^\bullet$ and $\mathcal{F}^\bullet$
be finite complexes of finite locally free $\mathcal{O}_X$-modules.
Let $\alpha^\bullet, \beta^\bullet :\mathcal{E}^\bullet \to \mathcal{F}^\bullet$
be two maps of complexes defining the same map in $D(\mathcal{O}_X)$.
Then there exists a quasi-isomorphism
$\gamma^\bullet : \mathcal{G}^\bullet \to \mathcal{E}^\bullet$
where $\mathcal{G}^\bullet$ is a bounded complex of finite locally free
$\mathcal{O}_X$-modules
such that $\alpha^\bullet \circ \gamma^\bullet$ and
$\beta^\bullet \circ \gamma^\bullet$ are homotopic maps of complexes.
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-resolution-property-affine-diagonal}
we see that $X$ has affine diagonal. Hence by
Proposition \ref{proposition-quasi-compact-affine-diagonal}
(and the definition of the derived category)
there exists a quasi-isomorphism
$\gamma^\bullet : \mathcal{G}^\bullet \to \mathcal{E}^\bullet$
where $\mathcal{G}^\bullet$ is a complex of quasi-coherent
$\mathcal{O}_X$-modules
such that $\alpha^\bullet \circ \gamma^\bullet$ and
$\beta^\bullet \circ \gamma^\bullet$ are homotopic maps of complexes.
Choose a homotopy $h^i : \mathcal{G}^i \to \mathcal{F}^{i - 1}$
witnessing this fact. Choose $n \ll 0$. Then the map
$\gamma^\bullet$ factors canonically over the quotient
map $\mathcal{G}^\bullet \to \tau_{\geq n}\mathcal{G}^\bullet$
as $\mathcal{E}^\bullet$ is bounded below. For the exact same
reason the maps $h^i$ will factor over the surjections
$\mathcal{G}^i \to (\tau_{\geq n}\mathcal{G})^i$.
Hence we see that we may replace $\mathcal{G}^\bullet$
by $\tau_{\geq n}\mathcal{G}^\bullet$.
Then we may apply Lemma \ref{lemma-construct-strictly-perfect} to conclude.
\end{proof}

\begin{proposition}
\label{proposition-perfect-resolution-property}
Let $X$ be a quasi-compact and quasi-separated scheme with the
resolution property. Denote
\begin{enumerate}
\item $\mathcal{A}$ the additive category of finite locally free
$\mathcal{O}_X$-modules,
\item $K^b(\mathcal{A})$ the homotopy category of bounded complexes
in $\mathcal{A}$, see
Derived Categories, Section \ref{derived-section-homotopy}, and
\item $D_{perf}(\mathcal{O}_X)$ the strictly full, saturated,
triangulated subcategory of $D(\mathcal{O}_X)$ consisting of
perfect objects.
\end{enumerate}
With this notation the obvious functor
$$
K^b(\mathcal{A}) \longrightarrow D_{perf}(\mathcal{O}_X)
$$
is an exact functor of trianglated categories which factors through an
equivalence $S^{-1}K^b(\mathcal{A}) \to D_{perf}(\mathcal{O}_X)$
of triangulated categories
where $S$ is the saturated multiplicative system of quasi-isomorphisms
in $K^b(\mathcal{A})$.
\end{proposition}

\begin{proof}
If you can parse the statement of the proposition, then please skip this
first paragraph. For some of the definitions used, please see
Derived Categories, Definition
\ref{derived-definition-triangulated-subcategory}
(triangulated subcategory),
Derived Categories, Definition \ref{derived-definition-saturated}
(saturated triangulated subcategory),
Derived Categories, Definition \ref{derived-definition-localization}
(multiplicative system compatible with the triangulated structure), and
Categories,
Definition \ref{categories-definition-saturated-multiplicative-system}
(saturated multiplicative system).
Observe that $D_{perf}(\mathcal{O}_X)$ is a saturated triangulated subcategory
of $D(\mathcal{O}_X)$ by
Cohomology, Lemmas \ref{cohomology-lemma-two-out-of-three-perfect} and
\ref{cohomology-lemma-summands-perfect}. Also, note that
$K^b(\mathcal{A})$ is a triangulated category, see
Derived Categories, Lemma
\ref{derived-lemma-bounded-triangulated-subcategories}.

\medskip\noindent
It is clear that the functor sends distinguished triangles to
distinguished triangles, i.e., is exact. Then $S$ is a saturated
multiplicative system compatible with the triangulated structure
on $K^b(\mathcal{A})$ by
Derived Categories, Lemma \ref{derived-lemma-triangle-functor-localize}.
Hence the localization $S^{-1}K^b(\mathcal{A})$ exists and is
a triangulated category by
Derived Categories, Proposition
\ref{derived-proposition-construct-localization}.
We get an exact factorization
$S^{-1}K^b(\mathcal{A}) \to D_{perf}(\mathcal{O}_X)$ by
Derived Categories, Lemma
\ref{derived-lemma-universal-property-localization}.
By Lemmas \ref{lemma-resolution-property-perfect-complex},
\ref{lemma-resolution-property-map-perfect-complex}, and
\ref{lemma-resolution-property-homotopy-map-perfect-complex}
this functor is an equivalence. Then finally the functor
$S^{-1}K^b(\mathcal{A}) \to D_{perf}(\mathcal{O}_X)$
is an equivalence of triangulated categories (in the sense that
distinguished triangles correspond) by
Derived Categories, Lemma \ref{derived-lemma-exact-equivalence}.
\end{proof}






\section{K-groups}
\label{section-K-groups}

\noindent
A tiny bit about $K_0$ of various categories associated to schemes.
Previous material can be found in
Algebra, Section \ref{algebra-section-K-groups},
Homology, Section \ref{homology-section-K-groups},
Derived Categories, Section \ref{derived-section-K-groups}, and
More on Algebra, Lemma \ref{more-algebra-lemma-perfect-to-K-group-universal}.

\medskip\noindent
Analogous to Algebra, Section \ref{algebra-section-K-groups}
we will define two $K$-groups $K'_0(X)$ and $K_0(X)$ for any
Noetherian scheme $X$. The first will use coherent $\mathcal{O}_X$-modules
and the second will use finite locally free $\mathcal{O}_X$-modules.

\begin{lemma}
\label{lemma-Noetherian-Kprime}
Let $X$ be a Noetherian scheme. Then
$$
K_0(\textit{Coh}(\mathcal{O}_X)) =
K_0(D^b(\textit{Coh}(\mathcal{O}_X)) =
K_0(D^b_{\textit{Coh}}(\mathcal{O}_X))
$$
\end{lemma}

\begin{proof}
The first equality is
Derived Categories, Lemma \ref{derived-lemma-K-bounded-derived}.
We have $K_0(\textit{Coh}(\mathcal{O}_X)) =
K_0(D^b_{\textit{Coh}}(\mathcal{O}_X))$ by
Derived Categories, Lemma \ref{derived-lemma-DBA-map-K}.
This proves the lemma.
(We can also use that
$D^b(\textit{Coh}(\mathcal{O}_X)) = D^b_{\textit{Coh}}(\mathcal{O}_X)$
by Proposition \ref{proposition-DCoh} to see the second
equality.)
\end{proof}

\noindent
Here is the definition.

\begin{definition}
\label{definition-K-group}
Let $X$ be a scheme.
\begin{enumerate}
\item We denote $K_0(X)$ the {\it Grothendieck group of $X$}. It is the
zeroth K-group of the strictly full, saturated, triangulated subcategory
$D_{perf}(\mathcal{O}_X)$ of $D(\mathcal{O}_X)$ consisting of perfect objects.
In a formula
$$
K_0(X) = K_0(D_{perf}(\mathcal{O}_X))
$$
\item If $X$ is locally Noetherian, then we denote $K'_0(X)$ the
{\it Grothendieck group of coherent sheaves on $X$}. It is the
is the zeroth $K$-group of the abelian category
of coherent $\mathcal{O}_X$-modules. In a formula
$$
K'_0(X) = K_0(\textit{Coh}(\mathcal{O}_X))
$$
\end{enumerate}
\end{definition}

\noindent
We will show that our definition of $K_0(X)$ agrees with the often used
definition in terms of finite locally free modules if $X$ has the
resolution property (for example if $X$ has an ample invertible module).
See Lemma \ref{lemma-K-is-old-K}.

\begin{lemma}
\label{lemma-K-agrees-affine}
Let $X = \Spec(R)$ be an affine scheme. Then $K_0(X) = K_0(R)$
and if $R$ is Noetherian then $K'_0(X) = K'_0(R)$.
\end{lemma}

\begin{proof}
Recall that $K'_0(R)$ and $K_0(R)$ have been defined in
Algebra, Section \ref{algebra-section-K-groups}.

\medskip\noindent
By More on Algebra, Lemma \ref{more-algebra-lemma-perfect-to-K-group-universal}
we have $K_0(R) = K_0(D_{perf}(R))$.
By Lemmas \ref{lemma-perfect-affine} and \ref{lemma-affine-compare-bounded}
we have $D_{perf}(R) = D_{perf}(\mathcal{O}_X)$.
This proves the equality $K_0(R) = K_0(X)$.

\medskip\noindent
The equality $K'_0(R) = K'_0(X)$ holds because
$\textit{Coh}(\mathcal{O}_X)$ is equivalent to the category
of finite $R$-modules by Cohomology of Schemes, Lemma
\ref{coherent-lemma-coherent-Noetherian}. Moreover it is
clear that $K'_0(R)$ is the zeroth K-group of the category
of finite $R$-modules from the definitions.
\end{proof}

\noindent
Let $X$ be a Noetherian scheme. Then both $K'_0(X)$ and $K_0(X)$
are defined. In this case there is a canonical map
$$
K_0(X) = K_0(D_{perf}(\mathcal{O}_X))
\longrightarrow
K_0(D^b_{\textit{Coh}}(\mathcal{O}_X)) = K'_0(X)
$$
Namely, perfect complexes are in $D^b_{\textit{Coh}}(\mathcal{O}_X)$
(by Lemma \ref{lemma-identify-pseudo-coherent-noetherian}), the inclusion
functor
$D_{perf}(\mathcal{O}_X) \to D^b_{\textit{Coh}}(\mathcal{O}_X)$
induces a map on zeroth $K$-groups
(Derived Categories, Lemma \ref{derived-lemma-map-K}),
and we have the equality on the right by
Lemma \ref{lemma-Noetherian-Kprime}.

\begin{lemma}
\label{lemma-Kprime-K}
Let $X$ be a Noetherian regular scheme. Then
the map $K_0(X) \to K'_0(X)$ is an isomorphism.
\end{lemma}

\begin{proof}
Follows immediately from Lemma \ref{lemma-perfect-on-regular}
and our construction of the map $K_0(X) \to K'_0(X)$ above.
\end{proof}

\noindent
Let $X$ be a scheme. Let us denote $\textit{Vect}(X)$ the category
of finite locally free $\mathcal{O}_X$-modules. Although
$\textit{Vect}(X)$ isn't an abelian category in general, it
is clear what a short exact sequence of $\textit{Vect}(X)$ is.
Denote $K_0(\textit{Vect}(X))$ the unique abelian group with the
following properties\footnote{The correct generality here
would be to define $K_0$ for any exact category, see
Injectives, Remark \ref{injectives-remark-embed-exact-category}.}:
\begin{enumerate}
\item For every finite locally free $\mathcal{O}_X$-module $\mathcal{E}$ there
is given an element $[\mathcal{E}]$ in $K_0(\textit{Vect}(X))$,
\item for every short exact sequence
$0 \to \mathcal{E}' \to \mathcal{E} \to \mathcal{E}'' \to 0$
of finite locally free $\mathcal{O}_X$-modules we have the relation
$[\mathcal{E}] = [\mathcal{E}'] + [\mathcal{E}'']$ in $K_0(\textit{Vect}(X))$,
\item the group $K_0(\textit{Vect}(X))$ is generated by the elements
$[\mathcal{E}]$, and
\item all relations in $K_0(\textit{Vect}(X))$ among the generators
$[\mathcal{E}]$ are $\mathbf{Z}$-linear combinations
of the relations coming from exact sequences as above.
\end{enumerate}
We omit the detailed construction of $K_0(\textit{Vect}(X))$.
There is a natural map
$$
K_0(\textit{Vect}(X)) \longrightarrow K_0(X)
$$
Namely, given a finite locally free $\mathcal{O}_X$-module $\mathcal{E}$
let us denote $\mathcal{E}[0]$ the perfect complex on $X$ which has
$\mathcal{E}$ sitting in degree $0$ and zero in other degrees.
Given a short exact sequence
$0 \to \mathcal{E} \to \mathcal{E}' \to \mathcal{E}'' \to 0$ of finite
locally free $\mathcal{O}_X$-modules we obtain a distinguished triangle
$\mathcal{E}[0] \to \mathcal{E}'[0] \to \mathcal{E}''[0] \to \mathcal{E}[1]$,
see Derived Categories, Section \ref{derived-section-canonical-delta-functor}.
This shows that we obtain a map
$K_0(\textit{Vect}(X)) \to K_0(D_{perf}(\mathcal{O}_X)) = K_0(X)$
by sending $[\mathcal{E}]$ to $[\mathcal{E}[0]]$
with apologies for the horrendous notation.

\begin{lemma}
\label{lemma-K-is-old-K}
Let $X$ be a quasi-compact and quasi-separated scheme with the
resolution property. Then the map $K_0(\textit{Vect}(X)) \to K_0(X)$
is an isomorphism.
\end{lemma}

\begin{proof}
This lemma will follow in a straightforward manner from
Lemmas \ref{lemma-resolution-property-perfect-complex},
\ref{lemma-resolution-property-map-perfect-complex}, and
\ref{lemma-resolution-property-homotopy-map-perfect-complex}
whose results we will use without further mention.
Let us construct an inverse map
$$
c : K_0(X) = K_0(D_{perf}(\mathcal{O}_X)) \longrightarrow
K_0(\textit{Vect}(X))
$$
Namely, any object of $D_{perf}(\mathcal{O}_X)$ can be represented
by a bounded complex $\mathcal{E}^\bullet$ of finite locally free
$\mathcal{O}_X$-modules. Then we set
$$
c([\mathcal{E}^\bullet]) = \sum (-1)^i[\mathcal{E}^i]
$$
Of course we have to show that this is well defined. For the moment
we view $c$ as a map defined on bounded complexes of finite locally free
$\mathcal{O}_X$-modules.

\medskip\noindent
Suppose that $\mathcal{E}^\bullet \to \mathcal{F}^\bullet$ is a surjective map
of bounded complexes of finite locally free $\mathcal{O}_X$-modules.
Let $\mathcal{K}^\bullet$ be the kernel. Then we obtain short exact
sequences of $\mathcal{O}_X$-modules
$$
0 \to \mathcal{K}^n \to \mathcal{E}^n \to \mathcal{F}^n \to 0
$$
which are locally split because $\mathcal{F}^n$ is finite locally free.
Hence $\mathcal{K}^\bullet$ is also a bounded complex of finite
locally free $\mathcal{O}_X$-modules and we have
$c(\mathcal{E}^\bullet) = c(\mathcal{K}^\bullet) + c(\mathcal{F}^\bullet)$
in $K_0(\textit{Vect}(X))$.

\medskip\noindent
Suppose given a bounded complex $\mathcal{E}^\bullet$
of finite locally free $\mathcal{O}_X$-modules which is acyclic.
Say $\mathcal{E}^n = 0$ for $n \not \in [a, b]$. Then we
can break $\mathcal{E}^\bullet$ into short exact sequences
$$
\begin{matrix}
0 \to \mathcal{E}^a \to \mathcal{E}^{a + 1} \to \mathcal{F}^{a + 1} \to 0,\\
0 \to \mathcal{F}^{a + 1} \to \mathcal{E}^{a + 2} \to
\mathcal{F}^{a + 3} \to 0, \\
\ldots \\
0 \to \mathcal{F}^{b - 3} \to \mathcal{E}^{b - 2} \to
\mathcal{F}^{b - 2} \to 0, \\
0 \to \mathcal{F}^{b - 2} \to \mathcal{E}^{b - 1} \to \mathcal{E}^b \to 0
\end{matrix}
$$
Arguing by descending induction we see that
$\mathcal{F}^{b - 2}, \ldots, \mathcal{F}^{a + 1}$
are finite locally free $\mathcal{O}_X$-modules, and
$$
c(\mathcal{E}^\bullet) = \sum (-1)[\mathcal{E}^n] =
\sum (-1)^n([\mathcal{F}^{n - 1}] + [\mathcal{F}^n]) = 0
$$
Thus our construction gives zero on acyclic complexes.

\medskip\noindent
It follows from the results of the preceding two paragraphs that $c$
is well defined. Namely, suppose the bounded complexes
$\mathcal{E}^\bullet$ and $\mathcal{F}^\bullet$ of finite locally free
$\mathcal{O}_X$-modules represent the same object of $D(\mathcal{O}_X)$.
Then we can find quasi-isomorphisms
$a : \mathcal{G}^\bullet \to \mathcal{E}^\bullet$ and
$b : \mathcal{G}^\bullet \to \mathcal{F}^\bullet$
with $\mathcal{G}^\bullet$ bounded complex of finite locally free
$\mathcal{O}_X$-modules.
We obtain a short exact sequence of complexes
$$
0 \to \mathcal{E}^\bullet \to C(a)^\bullet \to \mathcal{G}^\bullet[1] \to 0
$$
see Derived Categories, Definition \ref{derived-definition-cone}.
Since $a$ is a quasi-isomorphism, the cone $C(a)^\bullet$ is
acyclic (this follows for example from the discussion in
Derived Categories, Section \ref{derived-section-canonical-delta-functor}).
Hence
$$
0 = c(C(f)^\bullet) = c(\mathcal{E}^\bullet) + c(\mathcal{G}^\bullet[1]) =
c(\mathcal{E}^\bullet) - c(\mathcal{G}^\bullet)
$$
as desired. The same argument using $b$ shows that
$0 = c(\mathcal{F}^\bullet) - c(\mathcal{G}^\bullet)$.
Hence we find that $c(\mathcal{E}^\bullet) = c(\mathcal{F}^\bullet)$
and $c$ is well defined.

\medskip\noindent
A similar argument using the cone on a map
$\mathcal{E}^\bullet \to \mathcal{F}^\bullet$
of bounded complexes of finite locally free $\mathcal{O}_X$-modules
shows that $c(Y) = c(X) + c(Z)$ if $X \to Y \to Z$ is a distinguished triangle
in $D_{perf}(\mathcal{O}_X)$. Details omitted.
Thus we get the desired homomorphism
of abelian groups $c : K_0(X) \to K_0(\textit{Vect}(X))$.

\medskip\noindent
It is clear that the composition
$K_0(\textit{Vect}(X)) \to K_0(X) \to K_0(\textit{Vect}(X))$
is the identity. On the other hand, let $\mathcal{E}^\bullet$
be a bounded complex of finite locally free $\mathcal{O}_X$-modules.
Then the the existence of the distinguished triangles
of ``stupid truncations''
(see Homology, Section \ref{homology-section-truncations})
$$
\sigma_{\geq n}\mathcal{E}^\bullet \to
\sigma_{\geq n - 1}\mathcal{E}^\bullet \to
\mathcal{E}^{n - 1}[-n + 1] \to
(\sigma_{\geq n}\mathcal{E}^\bullet)[1]
$$
and induction show that
$$
[\mathcal{E}^\bullet] = \sum (-1)^i[\mathcal{E}^i[0]]
$$
in $K_0(X) = K_0(D_{perf}(\mathcal{O}_X))$ with apologies for the notation.
Hence the map $K_0(\textit{Vect}(X)) \to K_0(D_{perf}(\mathcal{O}_X)) = K_0(X)$
is surjective which finishes the proof.
\end{proof}

\begin{remark}
\label{remark-K-ring}
Let $X$ be a scheme. The K-group $K_0(X)$ is canonically a commutative ring.
Namely, using the derived tensor product
$$
\otimes = \otimes^\mathbf{L}_{\mathcal{O}_X} :
D_{perf}(\mathcal{O}_X) \times D_{perf}(\mathcal{O}_X)
\longrightarrow
D_{perf}(\mathcal{O}_X)
$$
and Derived Categories, Lemma \ref{derived-lemma-bilinear-map-K}
we obtain a bilinear multiplication. Since $K \otimes L \cong L \otimes K$
we see that this product is commutative. Since
$(K \otimes L) \otimes M = K \otimes (L \otimes M)$
we see that this product is associative.
Finally, the unit of $K_0(X)$ is the element $1 = [\mathcal{O}_X]$.

\medskip\noindent
If $\textit{Vect}(X)$ and $K_0(\textit{Vect}(X))$ are as above, then
it is clearly the case that $K_0(\textit{Vect}(X))$ also has a
ring structure: if $\mathcal{E}$ and $\mathcal{F}$ are finite locally free
$\mathcal{O}_X$-modules, then we set
$$
[\mathcal{E}] \cdot [\mathcal{F}] =
[\mathcal{E} \otimes_{\mathcal{O}_X} \mathcal{F}]
$$
The reader easily verifies that this indeed defines a bilinear
commutative, associative product. Details omitted. The map
$$
K_0(\textit{Vect}(X)) \longrightarrow K_0(X)
$$
constructed above is a ring map with these definitions.

\medskip\noindent
Now assume $X$ is Noetherian. The derived tensor product also produces
a map
$$
\otimes = \otimes^\mathbf{L}_{\mathcal{O}_X} :
D_{perf}(\mathcal{O}_X) \times D^b_{\textit{Coh}}(\mathcal{O}_X)
\longrightarrow
D^b_{\textit{Coh}}(\mathcal{O}_X)
$$
Again using Derived Categories, Lemma \ref{derived-lemma-bilinear-map-K}
we obtain a bilinear multiplication $K_0(X) \times K'_0(X) \to K'_0(X)$
since $K'_0(X) = K_0(D^b_{\textit{Coh}}(\mathcal{O}_X))$ by
Lemma \ref{lemma-Noetherian-Kprime}.
The reader easily shows that this gives $K'_0(X)$ the structure
of a module over the ring $K_0(X)$.
\end{remark}

\begin{remark}
\label{remark-pushforward-K}
Let $f : X \to Y$ be a proper morphism of locally Noetherian schemes.
There is a map
$$
f_* : K'_0(X) \longrightarrow K'_0(Y)
$$
which sends $[\mathcal{F}]$ to
$$
[\bigoplus\nolimits_{i \geq 0} R^{2i}f_*\mathcal{F}] -
[\bigoplus\nolimits_{i \geq 0} R^{2i + 1}f_*\mathcal{F}]
$$
This is well defined because the sheaves $R^if_*\mathcal{F}$
are coherent (Cohomology of Schemes, Proposition
\ref{coherent-proposition-proper-pushforward-coherent}), because locally
only a finite number are nonzero, and because
a short exact sequence of coherent sheaves on $X$ produces a long
exact sequence of $R^if_*$ on $Y$. If $Y$ is quasi-compact (the only
case most often used in practice), then we can rewrite the above as
$$
f_*[\mathcal{F}] = \sum (-1)^i[R^if_*\mathcal{F}] = [Rf_*\mathcal{F}]
$$
where we have used the equality $K'_0(Y) = K_0(D^b_{\textit{Coh}}(Y))$ from
Lemma \ref{lemma-Noetherian-Kprime}.
\end{remark}

\begin{lemma}
\label{lemma-projection-formula}
Let $f : X \to Y$ be a proper morphism of locally Noetherian schemes.
Then we have $f_*(\alpha \cdot f^*\beta) = f_*\alpha \cdot \beta$
for $\alpha \in K'_0(X)$ and $\beta \in K_0(Y)$.
\end{lemma}

\begin{proof}
Follows from Lemma \ref{lemma-cohomology-base-change}, the discussion in
Remark \ref{remark-pushforward-K}, and the definition of the product
$K'_0(X) \times K_0(X) \to K'_0(X)$ in Remark \ref{remark-K-ring}.
\end{proof}

\begin{remark}
\label{remark-perf-Z}
Let $X$ be a scheme. Let $Z \subset X$ be a closed subscheme. Consider the
strictly full, saturated, triangulated subcategory
$$
D_{Z, perf}(\mathcal{O}_X) \subset D(\mathcal{O}_X)
$$
consisting of perfect complexes of $\mathcal{O}_X$-modules
whose cohomology sheaves are settheoretically supported on $Z$.
The zeroth $K$-group $K_0(D_{Z, perf}(\mathcal{O}_X))$
of this triangulated category is sometimes denoted
$K_Z(X)$ or $K_{0, Z}(X)$. Using derived tensor product exactly
as in Remark \ref{remark-K-ring} we see that $K_0(D_{Z, perf}(\mathcal{O}_X))$
has a multiplication which is associative and commutative,
but in general $K_0(D_{Z, perf}(\mathcal{O}_X))$ doesn't have a unit.
\end{remark}













\section{Determinants of complexes}
\label{section-det-two-terms}

\noindent
This section is the continuation of
More on Algebra, Section \ref{more-algebra-section-determinants-complexes}.
For any ringed space $(X, \mathcal{O}_X)$ there is a functor
$$
\det :
\left\{
\begin{matrix}
\text{category of perfect complexes} \\
\text{morphisms are isomorphisms}
\end{matrix}
\right\}
\longrightarrow
\left\{
\begin{matrix}
\text{category of invertible modules} \\
\text{morphisms are isomorphisms}
\end{matrix}
\right\}
$$
Moreover, given an object $(L, F)$ of the filtered derived category
$DF(\mathcal{O}_X)$ whose filtration is finite and whose graded parts
are perfect complexes, there is a canonical isomorphism
$\det(\text{gr}L) \to \det(L)$. See \cite{determinant} for the
original exposition. We will add this material later (insert future reference).

\medskip\noindent
For the moment we will present an ad hoc construction in the case
where $X$ is a scheme and where we consider perfect objects $L$ in
$D(\mathcal{O}_X)$ of tor-amplitude in $[-1, 0]$.

\begin{lemma}
\label{lemma-determinant-two-term-complexes}
Let $X$ be a scheme. There is a functor
$$
\det :
\left\{
\begin{matrix}
\text{category of perfect complexes} \\
\text{with tor amplitude in }[-1, 0] \\
\text{morphisms are isomorphisms}
\end{matrix}
\right\}
\longrightarrow
\left\{
\begin{matrix}
\text{category of invertible modules} \\
\text{morphisms are isomorphisms}
\end{matrix}
\right\}
$$
In addition, given a rank $0$ perfect object $L$ of $D(\mathcal{O}_X)$ with
tor-amplitude in $[-1, 0]$ there is a canonical element
$\delta(L) \in \Gamma(X, \det(L))$ such that for any isomorphism
$a : L \to K$ in $D(\mathcal{O}_X)$ we have $\det(a)(\delta(L)) = \delta(K)$.
Moreover, the construction is affine locally given by the construction
of More on Algebra, Section \ref{more-algebra-section-determinants-complexes}.
\end{lemma}

\begin{proof}
Let $L$ be an object of the left hand side. If $\Spec(A) = U \subset X$
is an affine open, then $L|_U$ corresponds to a perfect complex $L^\bullet$
of $A$-modules with tor-amplitude in $[-1, 0]$, see
Lemmas \ref{lemma-affine-compare-bounded},
\ref{lemma-tor-dimension-affine}, and
\ref{lemma-perfect-affine}.
Then we can consider the invertible $A$-module $\det(L^\bullet)$ constructed in
More on Algebra, Lemma \ref{more-algebra-lemma-determinant-two-term-complexes}.
If $\Spec(B) = V \subset U$ is another affine open contained in $U$,
then $\det(L^\bullet) \otimes_A B = \det(L^\bullet \otimes_A B)$
and hence this construction is compatible with restriction mappings
(see Lemma \ref{lemma-quasi-coherence-pullback} and note $A \to B$ is flat).
Thus we can glue these invertible modules to obtain an invertible module
$\det(L)$ on $X$. The functoriality and canonical sections
are constructed in exactly the same manner. Details omitted.
\end{proof}

\begin{remark}
\label{remark-functorial-det}
The construction of Lemma \ref{lemma-determinant-two-term-complexes}
is compatible with pullbacks. More precisely, given a morphism
$f : X \to Y$ of schemes and a perfect object $K$ of $D(\mathcal{O}_Y)$
of tor-amplitude in $[-1, 0]$ then $Lf^*K$ is a
perfect object $K$ of $D(\mathcal{O}_X)$
of tor-amplitude in $[-1, 0]$ and we have a canonical identification
$$
f^*\det(K) \longrightarrow \det(Lf^*K)
$$
Moreover, if $K$ has rank $0$, then $\delta(K)$ pulls back to
$\delta(Lf^*K)$ via this map. This is clear from the affine local
construction of the determinant.
\end{remark}






\section{Detecting Boundedness}
\label{section-detecting-boundedness}

\noindent
In this section, we show that compact generators of $D_\QCoh$ of a
quasi-compact, quasi-separated scheme, as constructed in
Section \ref{section-generating}, have a special property.
We recommend reading that section first as it is very similar to this one.

\begin{lemma}
\label{lemma-orthogonal-koszul-first-variant}
In Situation \ref{situation-complex} denote $j : U \to X$ the open
immersion and let $K$ be the perfect object of $D(\mathcal{O}_X)$
corresponding to the Koszul complex on $f_1, \ldots, f_r$ over $A$.
Let $E \in D_\QCoh(\mathcal{O}_X)$ and $a \in \mathbf{Z}$.
Consider the following conditions
\begin{enumerate}
\item The canonical map $\tau_{\geq a}E \to \tau_{\geq a} Rj_*(E|_U)$
is an isomorphism.
\item We have $\Hom_{D(\mathcal{O}_X)}(K[-n], E) = 0$ for all $n \geq a$.
\end{enumerate}
Then (2) implies (1) and (1) implies (2) with $a$ replaced by $a + 1$.
\end{lemma}

\begin{proof}
Choose a distinguished triangle $N \to E \to Rj_*(E|_U) \to N[1]$.
Then (1) implies $\tau_{\geq a + 1} N = 0$ and (1) is implied by
$\tau_{\geq a}N = 0$. Observe that
$$
\Hom_{D(\mathcal{O}_X)}(K[-n], Rj_*(E|_U)) =
\Hom_{D(\mathcal{O}_U)}(K|_U[-n], E) = 0
$$
for all $n$ as $K|_U = 0$. Thus (2) is equivalent to
$\Hom_{D(\mathcal{O}_X)}(K[-n], N) = 0$ for all $n \geq a$. 
Observe that there are distinguished triangles
$$
K^\bullet(f_1^{e_1}, \ldots, f_i^{e'_i}, \ldots, f_r^{e_r}) \to
K^\bullet(f_1^{e_1}, \ldots, f_i^{e'_i + e''_i}, \ldots, f_r^{e_r}) \to
K^\bullet(f_1^{e_1}, \ldots, f_i^{e''_i}, \ldots, f_r^{e_r}) \to \ldots
$$
of Koszul complexes, see
More on Algebra, Lemma \ref{more-algebra-lemma-koszul-mult}. Hence
$\Hom_{D(\mathcal{O}_X)}(K[-n], N) = 0$ for all $n \geq a$
is equivalent to
$\Hom_{D(\mathcal{O}_X)}(K_e[-n], N) = 0$ for all $n \geq a$ and
all $e \geq 1$ with $K_e$ as in
Lemma \ref{lemma-represent-cohomology-class-on-closed}.
Since $N|_U = 0$, that lemma implies that this in turn is equivalent to
$H^n(X, N) = 0$ for $n \geq a$. We conclude that (2) is equivalent
to $\tau_{\geq a}N = 0$ since $N$ is determined by the complex of
$A$-modules $R\Gamma(X, N)$, see Lemma \ref{lemma-affine-compare-bounded}.
Thus we find that our lemma is true.
\end{proof}

\begin{lemma}
\label{lemma-orthogonal-koszul-second-variant}
In Situation \ref{situation-complex} denote $j : U \to X$ the open
immersion and let $K$ be the perfect object of $D(\mathcal{O}_X)$
corresponding to the Koszul complex on $f_1, \ldots, f_r$ over $A$.
Let $E \in D_\QCoh(\mathcal{O}_X)$ and $a \in \mathbf{Z}$. Consider
the following conditions
\begin{enumerate}
\item The canonical map $\tau_{\leq a}E \to \tau_{\leq a} Rj_*(E|_U)$
is an isomorphism, and
\item $\Hom_{D(\mathcal{O}_X)}(K[-n], E) = 0$ for all $n \leq a$.
\end{enumerate}
Then (2) implies (1) and (1) implies (2) with $a$ replaced by $a - 1$.
\end{lemma}

\begin{proof}
Choose a distinguished triangle $E \to Rj_*(E|_U) \to N \to E[1]$. Then (1)
implies $\tau_{\leq a - 1}N = 0$ and (1) is implied by $\tau_{\leq a}N = 0$.
Observe that
$$
\Hom_{D(\mathcal{O}_X)}(K[-n], Rj_*(E|_U)) =
\Hom_{D(\mathcal{O}_U)}(K|_U[-n], E) = 0
$$
for all $n$ as $K|_U = 0$. Thus (2) is equivalent to
$\Hom_{D(\mathcal{O}_X)}(K[-n], N) = 0$ for all $n \leq a$. 
Observe that there are distinguished triangles
$$
K^\bullet(f_1^{e_1}, \ldots, f_i^{e'_i}, \ldots, f_r^{e_r}) \to
K^\bullet(f_1^{e_1}, \ldots, f_i^{e'_i + e''_i}, \ldots, f_r^{e_r}) \to
K^\bullet(f_1^{e_1}, \ldots, f_i^{e''_i}, \ldots, f_r^{e_r}) \to \ldots
$$
of Koszul complexes, see
More on Algebra, Lemma \ref{more-algebra-lemma-koszul-mult}. Hence
$\Hom_{D(\mathcal{O}_X)}(K[-n], N) = 0$ for all $n \leq a$
is equivalent to
$\Hom_{D(\mathcal{O}_X)}(K_e[-n], N) = 0$ for all $n \leq a$ and all $e \geq 1$
with $K_e$ as in Lemma \ref{lemma-represent-cohomology-class-on-closed}.
Since $N|_U = 0$, that lemma implies that this in turn is equivalent to
$H^n(X, N) = 0$ for $n \leq a$. We conclude that (2) is equivalent to
$\tau_{\leq a}N = 0$ since $N$ is determined by the complex of
$A$-modules $R\Gamma(X, N)$, see Lemma \ref{lemma-affine-compare-bounded}.
Thus we find that our lemma is true.
\end{proof}

\begin{lemma}
\label{lemma-bounded-truncation}
Let $X$ be a quasi-compact and quasi-separated scheme.
Let $P \in D_{perf}(\mathcal{O}_X)$ and $E \in D_{\QCoh}(\mathcal{O}_X)$. 
Let $a \in \mathbf{Z}$. The following are equivalent
\begin{enumerate}
\item $\Hom_{D(\mathcal{O}_X)}(P[-i], E) = 0$ for $i \gg 0$, and
\item $\Hom_{D(\mathcal{O}_X)}(P[-i], \tau_{\geq a} E) = 0$ for $i \gg 0$.
\end{enumerate}
\end{lemma}

\begin{proof}
Using the triangle $ \tau_{< a} E \to E \to \tau_{\geq a} E \to$
we see that the equivalence follows if we can show
$$
\Hom_{D(\mathcal{O}_X)}(P[-i], \tau_{< a} E) =
\Hom_{D(\mathcal{O}_X)}(P, (\tau_{< a} E)[i]) = 0 
$$
for $i \gg 0$. As $P$ is perfect this is true by
Lemma \ref{lemma-ext-from-perfect-into-bounded-QCoh}.
\end{proof}

\begin{lemma}
\label{lemma-bounded-below-truncation}
Let $X$ be a quasi-compact and quasi-separated scheme. Let
$P \in D_{perf}(\mathcal{O}_X)$ and $E \in D_{\QCoh}(\mathcal{O}_X)$.
Let $a \in \mathbf{Z}$. The following are equivalent
\begin{enumerate}
\item $\Hom_{D(\mathcal{O}_X)}(P[-i], E) = 0$ for $i \ll 0$, and
\item $\Hom_{D(\mathcal{O}_X)}(P[-i], \tau_{\leq a} E) = 0$ for $i \ll 0$.
\end{enumerate}
\end{lemma}

\begin{proof}
Using the triangle $ \tau_{\leq a} E \to E \to \tau_{> a} E \to$
we see that the equivalence follows if we can show
$$
\Hom_{D(\mathcal{O}_X)}(P[-i], \tau_{> a} E) =
\Hom_{D(\mathcal{O}_X)}(P, (\tau_{> a} E)[i]) = 0
$$
for $i \ll 0$. As $P$ is perfect this is true by
Lemma \ref{lemma-ext-from-perfect-into-bounded-QCoh}.
\end{proof}

\begin{proposition}
\label{proposition-detecting-bounded-above}
Let $X$ be a quasi-compact and quasi-separated scheme. Let
$G \in D_{perf}(\mathcal{O}_X)$ be a perfect complex which generates 
$D_\QCoh (\mathcal{O}_X)$. Let $E \in D_\QCoh (\mathcal{O}_X)$.
The following are equivalent
\begin{enumerate}
\item $E \in D^-_\QCoh (\mathcal{O}_X)$,
\item $\Hom_{D(\mathcal{O}_X)}(G[-i], E) = 0$ for $i \gg 0$,
\item $\Ext^i_X(G, E) = 0$ for $i \gg 0$,
\item $R\Hom_X(G, E)$ is in $D^-(\mathbf{Z})$,
\item $H^i(X, G^\vee \otimes_{\mathcal{O}_X}^\mathbf{L} E) = 0$
for $i \gg 0$,
\item $R\Gamma(X, G^\vee \otimes_{\mathcal{O}_X}^\mathbf{L} E)$
is in $D^-(\mathbf{Z})$,
\item for every perfect object $P$ of $D(\mathcal{O}_X)$
\begin{enumerate}
\item the assertions (2), (3), (4) hold with $G$ replaced by $P$, and
\item $H^i(X, P \otimes_{\mathcal{O}_X}^\mathbf{L} E) = 0$ for $i \gg 0$,
\item $R\Gamma(X, P \otimes_{\mathcal{O}_X}^\mathbf{L} E)$
is in $D^-(\mathbf{Z})$.
\end{enumerate}
\end{enumerate}
\end{proposition}

\begin{proof}
Assume (1). Since
$\Hom_{D(\mathcal{O}_X)}(G[-i], E) = \Hom_{D(\mathcal{O}_X)}(G, E[i])$
we see that this is zero for $i \gg 0$ by
Lemma \ref{lemma-ext-from-perfect-into-bounded-QCoh}. This proves
that (1) implies (2).

\medskip\noindent
Parts (2), (3), (4) are equivalent by the discussion in
Cohomology, Section \ref{cohomology-section-global-RHom}.
Part (5) and (6) are equivalent as $H^i(X, -) = H^i(R\Gamma(X, -))$
by definition. The equivalent conditions (2), (3), (4) are
equivalent to the equivalent conditions (5), (6) by
Cohomology, Lemma \ref{cohomology-lemma-dual-perfect-complex}
and the fact that $(G[-i])^\vee = G^\vee[i]$.

\medskip\noindent
It is clear that (7) implies (2). Conversely, 
let us prove that the equivalent conditions (2) -- (6) imply (7).
Recall that $G$ is a  classical generator for $D_{perf}(\mathcal{O}_X)$ by
Remark \ref{remark-classical-generator}.
For $P \in D_{perf}(\mathcal{O}_X)$ let $T(P)$ be the assertion that
$R\Hom_X(P, E)$ is in $D^-(\mathbf{Z})$.
Clearly, $T$ is inherited by direct sums,
satisfies the 2-out-of-three property for distinguished
triangles, is inherited by direct summands, and is preserved by shifts.
Hence by Derived Categories, Remark \ref{derived-remark-check-on-generator}
we see that (4) implies $T$ holds on all of $D_{perf}(\mathcal{O}_X)$.
The same argument works for all other properties, except that for property
(7)(b) and (7)(c) we also use that $P \mapsto P^\vee$ is a self
equivalence of $D_{perf}(\mathcal{O}_X)$. Small detail omitted.

\medskip\noindent
We will prove the equivalent conditions (2) -- (7) imply (1)
using the induction principle of
Cohomology of Schemes, Lemma \ref{coherent-lemma-induction-principle}.

\medskip\noindent
First, we prove (2) -- (7) $\Rightarrow$ (1) if $X$ is affine.
Set $P = \mathcal{O}_X[0]$. From (7) we obtain $H^i (X, E) = 0$ for $i \gg 0$.
Hence (1) follows since $E$ is determined by $R\Gamma (X, E)$,
see Lemma \ref{lemma-affine-compare-bounded}.

\medskip\noindent
Now assume $X = U \cup V$ with $U$ a quasi-compact open of $X$ and
$V$ an affine open, and assume the implication (2) -- (7) $\Rightarrow$ (1)
is known for the schemes $U$, $V$, and $U \cap V$.
Suppose $E \in D_\QCoh(\mathcal{O}_X)$ satisfies (2) -- (7).
By Lemma \ref{lemma-direct-summand-of-a-restriction} and
Theorem \ref{theorem-bondal-van-den-Bergh} there exists a perfect
complex $Q$ on $X$ such that $Q|_U$ generates $D_\QCoh (\mathcal{O}_U)$. 
Let $f_1, \dots , f_r \in \Gamma (V, \mathcal{O}_V)$
be such that $V \setminus U = V(f_1, \dots , f_r)$ as subsets of
$V$. Let $K \in D_{perf}(\mathcal{O}_V)$ be the object
corresponding to the Koszul complex on $f_1, \dots , f_r$.
Let $K' \in D_{perf}(\mathcal{O}_X)$ be
\begin{equation}
\label{equation-detecting-bounded-above}
K' = R (V \to X)_* K = R (V \to X)_! K,
\end{equation}
see Cohomology, Lemmas \ref{cohomology-lemma-pushforward-restriction} and
\ref{cohomology-lemma-pushforward-perfect}. This is a perfect
complex on $X$ supported on the closed set $X \setminus U \subset V$
and isomorphic to $K$ on $V$. By assumption, we know
$R\Hom_{\mathcal{O}_X}(Q, E)$ and
$R\Hom_{\mathcal{O}_X}(K', E)$ are bounded above.

\medskip\noindent
By the second description of $K'$ in (\ref{equation-detecting-bounded-above})
we have
$$
\Hom_{D(\mathcal{O}_V)}(K[-i], E|_V) = \Hom_{D(\mathcal{O}_X)}(K'[-i], E) = 0
$$
for $i \gg 0$. Therefore, we may apply
Lemma \ref{lemma-orthogonal-koszul-first-variant} to $E|_V$ to
obtain an integer $a$ such that
$\tau_{\geq a}(E|_V) = \tau_{\geq a} R (U \cap V \to V)_* (E|_{U \cap V})$.
Then $\tau_{\geq a} E = \tau_{\geq a} R (U \to X)_* (E |_U)$
(check that the canonical map is an isomorphism after restricting to
$U$ and to $V$). Hence using Lemma \ref{lemma-bounded-truncation}
twice we see that
$$
\Hom_{D(\mathcal{O}_U)}(Q|_U [-i], E|_U) =
\Hom_{D(\mathcal{O}_X)}(Q[-i], R (U \to X)_* (E|_U)) = 0
$$
for $i \gg 0$. Since the Proposition holds for $U$ and the generator
$Q|_U$, we have $E|_U \in D^-_\QCoh(\mathcal{O}_U)$. But then since
the functor $R (U \to X)_*$ preserves $D^-_\QCoh$ 
(by Lemma \ref{lemma-quasi-coherence-direct-image}), we get
$\tau_{\geq a}E \in D^-_\QCoh(\mathcal{O}_X)$. Thus 
$E \in D^-_\QCoh (\mathcal{O}_X)$. 
\end{proof}

\begin{proposition}
\label{proposition-detecting-bounded-below}
Let $X$ be a quasi-compact and quasi-separated scheme.
Let $G \in D_{perf}(\mathcal{O}_X)$
be a perfect complex which generates $D_\QCoh (\mathcal{O}_X)$. Let
$E \in D_\QCoh (\mathcal{O}_X)$. The following are equivalent
\begin{enumerate}
\item $E \in D^+_\QCoh (\mathcal{O}_X)$,
\item $\Hom_{D(\mathcal{O}_X)}(G[-i], E) = 0$ for $i \ll 0$,
\item $\Ext^i_X(G, E) = 0$ for $i \ll 0$,
\item $R\Hom_X(G, E)$ is in $D^+(\mathbf{Z})$,
\item $H^i(X, G^\vee \otimes_{\mathcal{O}_X}^\mathbf{L} E) = 0$
for $i \ll 0$,
\item $R\Gamma(X, G^\vee \otimes_{\mathcal{O}_X}^\mathbf{L} E)$
is in $D^+(\mathbf{Z})$,
\item for every perfect object $P$ of $D(\mathcal{O}_X)$
\begin{enumerate}
\item the assertions (2), (3), (4) hold with $G$ replaced by $P$, and
\item $H^i(X, P \otimes_{\mathcal{O}_X}^\mathbf{L} E) = 0$ for $i \ll 0$,
\item $R\Gamma(X, P \otimes_{\mathcal{O}_X}^\mathbf{L} E)$
is in $D^+(\mathbf{Z})$.
\end{enumerate}
\end{enumerate}
\end{proposition}

\begin{proof}
Assume (1). Since
$\Hom_{D(\mathcal{O}_X)}(G[-i], E) = \Hom_{D(\mathcal{O}_X)}(G, E[i])$
we see that this is zero for $i \ll 0$ by
Lemma \ref{lemma-ext-from-perfect-into-bounded-QCoh}. This proves
that (1) implies (2).

\medskip\noindent
Parts (2), (3), (4) are equivalent by the discussion in
Cohomology, Section \ref{cohomology-section-global-RHom}.
Part (5) and (6) are equivalent as $H^i(X, -) = H^i(R\Gamma(X, -))$
by definition. The equivalent conditions (2), (3), (4) are
equivalent to the equivalent conditions (5), (6) by
Cohomology, Lemma \ref{cohomology-lemma-dual-perfect-complex}
and the fact that $(G[-i])^\vee = G^\vee[i]$.

\medskip\noindent
It is clear that (7) implies (2). Conversely, 
let us prove that the equivalent conditions (2) -- (6) imply (7).
Recall that $G$ is a  classical generator for $D_{perf}(\mathcal{O}_X)$ by
Remark \ref{remark-classical-generator}.
For $P \in D_{perf}(\mathcal{O}_X)$ let $T(P)$ be the assertion that
$R\Hom_X(P, E)$ is in $D^+(\mathbf{Z})$.
Clearly, $T$ is inherited by direct sums,
satisfies the 2-out-of-three property for distinguished
triangles, is inherited by direct summands, and is preserved by shifts.
Hence by Derived Categories, Remark \ref{derived-remark-check-on-generator}
we see that (4) implies $T$ holds on all of $D_{perf}(\mathcal{O}_X)$.
The same argument works for all other properties, except that for property
(7)(b) and (7)(c) we also use that $P \mapsto P^\vee$ is a self
equivalence of $D_{perf}(\mathcal{O}_X)$. Small detail omitted.

\medskip\noindent
We will prove the equivalent conditions (2) -- (7) imply (1)
using the induction principle of
Cohomology of Schemes, Lemma \ref{coherent-lemma-induction-principle}.

\medskip\noindent
First, we prove (2) -- (7) $\Rightarrow$ (1) if $X$ is affine.
Let $P = \mathcal{O}_X[0]$. From (7) we obtain $H^i (X, E) = 0$
for $i \ll 0$. Hence (1) follows since $E$ is
determined by $R\Gamma (X, E)$, see Lemma \ref{lemma-affine-compare-bounded}.

\medskip\noindent
Now assume $X = U \cup V$ with $U$ a quasi-compact open of $X$ and
$V$ an affine open, and assume the implication (2) -- (7) $\Rightarrow$ (1)
is known for the schemes $U$, $V$, and $U \cap V$.
Suppose $E \in D_\QCoh(\mathcal{O}_X)$ satisfies (2) -- (7).
By Lemma \ref{lemma-direct-summand-of-a-restriction} and
Theorem \ref{theorem-bondal-van-den-Bergh} there exists a perfect
complex $Q$ on $X$ such that $Q|_U$ generates $D_\QCoh (\mathcal{O}_U)$. 
Let $f_1, \dots , f_r \in \Gamma (V, \mathcal{O}_V)$
be such that $V \setminus U = V(f_1, \dots , f_r)$ as subsets of
$V$. Let $K \in D_{perf}(\mathcal{O}_V)$ be the object
corresponding to the Koszul complex on $f_1, \dots , f_r$.
Let $K' \in D_{perf}(\mathcal{O}_X)$ be
\begin{equation}
\label{equation-detecting-bounded-below}
K' = R (V \to X)_* K = R (V \to X)_! K,
\end{equation}
see Cohomology, Lemmas \ref{cohomology-lemma-pushforward-restriction} and
\ref{cohomology-lemma-pushforward-perfect}. This is a perfect
complex on $X$ supported on the closed set $X \setminus U \subset V$
and isomorphic to $K$ on $V$. By assumption, we know
$R\Hom_{\mathcal{O}_X}(Q, E)$ and
$R\Hom_{\mathcal{O}_X}(K', E)$ are bounded below.

\medskip\noindent
By the second description of $K'$ in (\ref{equation-detecting-bounded-below})
we have
$$
\Hom_{D(\mathcal{O}_V)}(K[-i], E|_V) = \Hom_{D(\mathcal{O}_X)}(K'[-i], E) = 0
$$
for $i \ll 0$. Therefore, we may apply
Lemma \ref{lemma-orthogonal-koszul-second-variant} to $E|_V$ to
obtain an integer $a$ such that
$\tau_{\leq a}(E|_V) = \tau_{\leq a} R(U \cap V \to V)_*(E|_{U \cap V})$.
Then $\tau_{\leq a} E = \tau_{\leq a} R(U \to X)_*(E|_U)$
(check that the canonical map is an isomorphism after restricting to
$U$ and to $V$). Hence using Lemma \ref{lemma-bounded-below-truncation}
twice we see that
$$
\Hom_{D(\mathcal{O}_U)}(Q|_U [-i], E|_U) =
\Hom_{D(\mathcal{O}_X)}(Q[-i], R (U \to X)_* (E|_U)) = 0
$$
for $i \ll 0$. Since the Proposition holds for $U$ and the generator
$Q|_U$, we have $E|_U \in D^+_\QCoh (\mathcal{O}_U)$. But then since
the functor $R(U \to X)_*$ preserves bounded below objects
(see Cohomology, Section \ref{cohomology-section-derived-functors}) we get
$\tau_{\leq a} E \in D^+_\QCoh(\mathcal{O}_X)$. Thus 
$E \in D^+_\QCoh (\mathcal{O}_X)$.
\end{proof}










\section{Quasi-coherent objects in the derived category}
\label{section-QC}

\noindent
Let $X$ be a scheme. Recall that $X_{affine, Zar}$
denotes the category of affine opens of $X$ with topology given
by standard Zariski coverings, see
Topologies, Definition \ref{topologies-definition-big-small-Zariski}.
We remind the reader that the topos of $X_{affine, Zar}$
is the small Zariski topos of $X$, see Topologies, Lemma
\ref{topologies-lemma-alternative-zariski}. The site $X_{affine, Zar}$
comes with a structure sheaf $\mathcal{O}$ and there is an
equivalence of ringed topoi
$$
(\Sh(X_{affine, Zar}), \mathcal{O})
\longrightarrow
(\Sh(X_{Zar}), \mathcal{O})
$$
See Descent, Equation (\ref{descent-equation-alternative-small-ringed})
and the discussion in
Descent, Section \ref{descent-section-alternative-quasi-coherent}
surrounding it where a slightly different notation is used.

\medskip\noindent
In this section we denote $X_{affine}$ the underlying category of
$X_{affine, Zar}$ endowed with the chaotic topology, i.e., such that sheaves
agree with presheaves. In particular, the structure sheaf $\mathcal{O}$
becomes a sheaf on $X_{affine}$ as well.
We obtain a morphisms of ringed sites
$$
\epsilon :
(X_{affine, Zar}, \mathcal{O})
\longrightarrow
(X_{affine}, \mathcal{O})
$$
as in Cohomology on Sites, Section \ref{sites-cohomology-section-compare}.
In this section we will identify $D_\QCoh(\mathcal{O}_X)$ with
the category $\mathit{QC}(X_{affine}, \mathcal{O})$ introduced in
Cohomology on Sites, Section \ref{sites-cohomology-section-modules-cohomology}.

\begin{lemma}
\label{lemma-DQCoh-alternative-small}
In the situation above there are canonical exact equivalences between
the following triangulated categories
\begin{enumerate}
\item $D_\QCoh(\mathcal{O}_X)$,
\item $D_\QCoh(X_{Zar}, \mathcal{O})$,
\item $D_\QCoh(X_{affine, Zar}, \mathcal{O})$,
\item $D_\QCoh(X_{affine}, \mathcal{O}_X)$, and
\item $\mathit{QC}(X_{affine}, \mathcal{O})$.
\end{enumerate}
\end{lemma}

\begin{proof}
If $U \subset V \subset X$ are affine open, then the ring map
$\mathcal{O}(V) \to \mathcal{O}(U)$ is flat. Hence
the equivalence between (4) and (5) is a special case of
Cohomology on Sites, Lemma
\ref{sites-cohomology-lemma-cartesian-flat-quasi-coherent}
(the proof also clarifies the statement).

\medskip\noindent
The ringed site $(X_{Zar}, \mathcal{O})$ and the ringed space
$(X, \mathcal{O}_X)$ have the same categories of modules by
Descent, Remark \ref{descent-remark-Zariski-site-space}.
Via this equivalence the quasi-coherent modules correspond by
Descent, Proposition \ref{descent-proposition-equivalence-quasi-coherent}.
Hence we get a canonical exact equivalence between the triangulated
categories in (1) and (2).

\medskip\noindent
The discussion preceding the lemma shows that we have an equivalence of
ringed topoi
$(\Sh(X_{affine, Zar}), \mathcal{O}) \to (\Sh(X_{Zar}), \mathcal{O})$
and hence an equivalence between abelian categories of modules.
Since the notion of quasi-coherent modules is intrinsic
(Modules on Sites, Lemma \ref{sites-modules-lemma-special-locally-free})
we see that this equivalence preserves the subcategories
of quasi-coherent modules. Thus  we get a canonical exact equivalence
between the triangulated categories in (2) and (3).

\medskip\noindent
To get an exact equivalence between the triangulated categories
in (3) and (4) we will apply Cohomology on Sites, Lemma
\ref{sites-cohomology-lemma-compare-topologies-derived-adequate-modules}
to the morphism $\epsilon : (X_{affine, Zar}, \mathcal{O}) \to
(X_{affine}, \mathcal{O})$ above. We take
$\mathcal{B} = \Ob(X_{affine})$ and we take
$\mathcal{A} \subset \textit{PMod}(X_{affine}, \mathcal{O})$
to be the full subcategory of those presheaves $\mathcal{F}$
such that $\mathcal{F}(V) \otimes_{\mathcal{O}(V)} \mathcal{O}(U)
\to \mathcal{F}(U)$ is an isomorphism. Observe that by
Descent, Lemma \ref{descent-lemma-quasi-coherent-alternative-small}
objects of $\mathcal{A}$ are exactly those sheaves in the Zariski
topology which are quasi-coherent modules on $(X_{affine, Zar}, \mathcal{O})$.
On the other hand, by Modules on Sites, Lemma
\ref{sites-modules-lemma-chaotic-quasi-coherent},
the objects of $\mathcal{A}$ are exactly the quasi-coherent modules
on $(X_{affine}, \mathcal{O})$, i.e., in the chaotic topology.
Thus if we show that Cohomology on Sites, Lemma
\ref{sites-cohomology-lemma-compare-topologies-derived-adequate-modules}
applies, then we do indeed get the canonical equivalence between the
categories of (3) and (4) using $\epsilon^*$ and $R\epsilon_*$.

\medskip\noindent
We have to verify 4 conditions:
\begin{enumerate}
\item Every object of $\mathcal{A}$ is a sheaf for the Zariski topology.
This we have seen above.
\item $\mathcal{A}$ is a weak Serre subcategory of
$\textit{Mod}(X_{affine, Zar}, \mathcal{O})$. Above we have
seen that $\mathcal{A} = \QCoh(X_{affine, Zar}, \mathcal{O})$ and
we have seen above that these,
via the equivalence $\textit{Mod}(X_{affine, Zar}, \mathcal{O}) =
\textit{Mod}(X, \mathcal{O}_X)$, correspond to the quasi-coherent modules
on $X$. Thus the result by the discussion in
Schemes, Section \ref{schemes-section-quasi-coherent}.
\item Every object of $X_{affine}$ has a covering in the chaotic
topology whose members are elements of $\mathcal{B}$. This holds
because $\mathcal{B}$ contains all objects.
\item For every object $U$ of $X_{affine}$ and $\mathcal{F}$ in $\mathcal{A}$
we have $H^p_{Zar}(U, \mathcal{F}) = 0$ for $p > 0$.
This holds by the vanishing of cohomology of quasi-coherent modules
on affines, see
Cohomology of Schemes, Lemma
\ref{coherent-lemma-quasi-coherent-affine-cohomology-zero}.
\end{enumerate}
This finishes the proof.
\end{proof}

\begin{remark}
\label{remark-QC-compare}
Let $S$ be a scheme. We will later show that also
$\mathit{QC}((\textit{Aff}/S), \mathcal{O})$
is canonically equivalent to $D_\QCoh(\mathcal{O}_S)$.
See Sheaves on Stacks, Proposition \ref{stacks-sheaves-proposition-QC-compare}.
\end{remark}








\input{chapters}

\bibliography{my}
\bibliographystyle{amsalpha}

\end{document}

